When running npm run build on a non-Windows environment (Linux), the build fails with the following error:
ReferenceError: window is not defined
at detect (/path/to/project/node_modules/echarts/dist/echarts.js:123:54)
at /path/to/project/node_modules/echarts/dist/echarts.js:97:9
at /path/to/project/node_modules/echarts/dist/echarts.js:22:68
at Object. (/path/to/project/node_modules/echarts/dist/echarts.js:25:2)
at Module._compile (node
/modules/cjs/loader:1467:14)
at Module._extensions..js (node
/modules/cjs/loader:1551:10)
at Module.load (node
/modules/cjs/loader:1282:32)
at Module._load (node
/modules/cjs/loader:1098:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node
/modules/cjs/loader:215:24)
To Reproduce
Clone the repository.
Run npm install --legacy-peer-deps.
Run npm run build on a non-Windows environment (e.g., Ubuntu).
Expected behavior
The build should succeed without any errors, as it does on a Windows environment.
Additional context
Add any other context about the problem here.
Node.js version: [e.g., 16.x]
NPM version: [e.g., 7.x]
Operating System: [e.g., Ubuntu 20.04]
Thank you!
Thank you for your assistance in resolving this issue.
Describe the bug
When running (/path/to/project/node_modules/echarts/dist/echarts.js:25:2)
at Module._compile (node
/modules/cjs/loader:1467:14)
at Module._extensions..js (node
/modules/cjs/loader:1551:10)
at Module.load (node
/modules/cjs/loader:1282:32)
at Module._load (node
/modules/cjs/loader:1098:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node
/modules/cjs/loader:215:24)
npm run build
on a non-Windows environment (Linux), the build fails with the following error: ReferenceError: window is not defined at detect (/path/to/project/node_modules/echarts/dist/echarts.js:123:54) at /path/to/project/node_modules/echarts/dist/echarts.js:97:9 at /path/to/project/node_modules/echarts/dist/echarts.js:22:68 at Object.To Reproduce
npm install --legacy-peer-deps
.npm run build
on a non-Windows environment (e.g., Ubuntu).Expected behavior
The build should succeed without any errors, as it does on a Windows environment.
Additional context
Add any other context about the problem here.
Thank you!
Thank you for your assistance in resolving this issue.