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

Not compatible with Webpack 5 (Next.js 11) #122

Open
Vadorequest opened this issue Jun 22, 2021 · 9 comments
Open

Not compatible with Webpack 5 (Next.js 11) #122

Vadorequest opened this issue Jun 22, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@Vadorequest
Copy link

Expected Behavior

Shouldn't log warnings

Current Behavior

When importing the file import { init } from '@amplitude/node';, it yields the following output:

warn  - ./node_modules/@amplitude/node/esm/src/constants.js
Should not import the named export 'version' (reexported as 'SDK_VERSION') from default-exporting module (only default export is available soon)

It's hard to tell if it's a warning or an error. The warning is displayed at every rebuild.

It seems to be related to webpack 5, the @amplitude/node package might not be compatible with Webpack 5. This affects Next.js 10+. (Webpack 5 is enabled by default in Next.js 11)

Steps to Reproduce

  1. git clone [email protected]:UnlyEd/next-right-now.git nrn-refactor-amplitude && cd nrn-refactor-amplitude && git checkout refactor-amplitude && cp .env.local.example .env.local && yarn && yarn start
  2. Go to localhost:8888/api/status and look at the server console

image

Environment

  • SDK Version: "@amplitude/node": "1.6.1",
  • Node version: v14
@Vadorequest Vadorequest added the bug Something isn't working label Jun 22, 2021
@yuhao900914
Copy link
Contributor

cc: @ajhorst @jooohhn

@GabeMedrash
Copy link

For reference: https://webpack.js.org/migrate/5/#using-named-exports-from-json-modules

@ncailleux
Copy link

Still here, same warning with "@amplitude/node": "^1.9.2" & "next": "^12.1.0"

@wrgoto
Copy link

wrgoto commented Jul 7, 2022

Any chance we can get an update on this to remove the warnings? It's really noisy.

@sbue
Copy link

sbue commented Jul 21, 2022

+1

@MrtMonet
Copy link

is there any progress on this?

@alerafart
Copy link

Any answers on this one?

@PavelMeyer
Copy link

Any updates?

@phillipjacobs
Copy link

@PavelMeyer did you manage to resolve it. Same issue on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants