Repository navigation
Local build failing #489
Description
Activity
@dev-geddy could you please try using node 16.15.0 or newer, the build process uses import assertions that look to have shipped in 16.14.0 but they were behind a flag until 16.15.0.
If you're unable to update your node version then you could also set the
NODE_OPTIONS='--experimental-json-modules'environment variable to enable that featureI have switched to node v16.15.1 (also tried v18), getting rollup-error:
❯ yarn build yarn run v1.22.18 $ npm run lint && rollup -c --environment NODE_ENV:production > @auth0/auth0-react@2.0.0 lint > eslint --ext=tsx ./src ./__tests__ (node:74788) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created) oidc-provider WARNING: Unsupported runtime. Use Node.js v18.x LTS, or a later LTS release. src/index.tsx → dist/auth0-react.js... [!] (plugin rpt2) RollupError: src/with-auth0.tsx:37:12 - error TS2786: 'Component' cannot be used as a JSX component. Its element type 'ReactElement<any, any> | Component<P, any, any> | null' is not a valid JSX element. Type 'Component<P, any, any>' is not assignable to type 'Element | ElementClass | null'. Type 'Component<P, any, any>' is not assignable to type 'ElementClass'. The types returned by 'render()' are incompatible between these types. Type 'React.ReactNode' is not assignable to type 'import("/Users/gediminas/WEB/auth0-react/node_modules/@types/react-test-renderer/node_modules/@types/react/index").ReactNode'. Type '{}' is not assignable to type 'ReactNode'. 37 <Component {...(props as P)} auth0={auth} /> ~~~~~~~~~ src/index.tsxIf you install the dependencies using npm do you see the same issue? I suspect that installing via yarn has maybe pulled in multiple versions of
@types/reactwhich are clashing, it works locally for me using npm as we have a package-lock that will ensure correct/aligned versionsI was able to npm install and compile locally by following the above. Thank you for help!
Describe the problem
What was the expected behaviour?
Reproduction
yarnto install dependenciesyarn buildEnvironment
auth0-reactused: 2.0.0