Skip to content

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

Description

@grant37

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions