-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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:
- older versions of
@findify/react-connect(at least pre-0.7.x) shipped with Node.js-compatible files inlib - seems that
@findify/react-connect@latestdoes not - only ES modules - this prevents the package from working out of the box in a Next.js app. see: Cannot use import statement outside a module vercel/next.js#9890
To reproduce the issue:
- clone this project https://github.com/grant37/findify-next
npm i
npm run buildexpected 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 devMetadata
Metadata
Assignees
Labels
No labels