Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest source files aren't compatible with Node.js - prevents out-of-the-box use in a Next.js app #750

Open
grant37 opened this issue Nov 20, 2021 · 0 comments

Comments

@grant37
Copy link

grant37 commented Nov 20, 2021

Would it be possible to publish source files that work in Node.js again? Seems like the latest package versions in the mono repo only provide ES modules. This change is breaking when the packages are used in a Next.js app.

I created a sample project here: https://github.com/grant37/findify-next, and here's a summary of the issue:

To reproduce the issue:

npm i
npm run build

expected result: project builds

actual result:

> build
> next build

info  - Checking validity of types
info  - Creating an optimized production build
info  - Compiled successfully

> Build error occurred
~/findify-next/node_modules/@findify/react-connect/lib/index.js:1
export { createProvider } from './provider/createProvider';
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.751 (~/findify-next/.next/server/pages/index.js:49:39)
    at __webpack_require__ (~/findify-next/.next/server/webpack-runtime.js:25:42)
    at __webpack_exec__ (~/findify-next/.next/server/pages/index.js:245:39) {
  type: 'SyntaxError'
}

You can see the same error in the browser with

npm run dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant