Closed MaksSlesarenko closed 5 years ago
auth0.js is not meant to be used in a server environment.
How can we only import if on client ?
With auth0.js ever work in angular universal? I have no need to use it if it can't.
TLDR: Removing auth0-js from the server side & batch processing while having auth0-js on the client side adds unnecessary complexity & rearchitecting to the app just to remove this warning.
Please consider making an isomorphic version of auth0-js. Non-browser shim methods with exceptions could be implemented. package.json > exports > browser
may be useful...https://nodejs.org/api/packages.html#conditional-exports
Edit: I located the cause for particular situation. I was importing the version from the auth0-js library. To fix the warning, I updated the import to:
import { version } from 'auth0-js/package.json'
This solution is not necessarily future-proof, but it works for now.
Isomorphic JS component libraries are common. The Hydration strategy of some of these libraries (e.g. SolidJS) require the DOM to be exactly the same for SSR & the initial CSR. Some of these libraries used on both the client & server side are also used for batch processing in a node.js environment. Typescript types are used in some of the logic, including error handling.
When upgrading from v9.6.1 to upper versions on the server I get following error:
Node v8.8 OS: Linux/Mac