amplitude / amplitude/Amplitude-Node

Not compatible with Webpack 5 (Next.js 11)

未關閉
#122 9 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
73
分支
20
PR 合併指標
30 天內沒有已合併 PR

描述

## 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 git@github.com: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](https://user-images.githubusercontent.com/3807458/122978280-a1eab200-d396-11eb-8e2c-adebffec0e93.png)

## Environment
- SDK Version: "@amplitude/node": "1.6.1",
- Node version: v14

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。