For the Build command in Netlify, I have tried with CI= npm run build and npm run build , but did not work
vite.config.ts
export default defineConfig({
plugins: [react()],
define: {
global: {}, // Have to use this, otherwise gave Uncaught ReferenceError: global is not defined
},
});
Hi
I got error when I tried to host my project on Netlify.
error during build: 6:49:18 PM: SyntaxError: Unexpected token (26:17183) in /opt/build/repo/node_modules/vis-data/peer/umd/vis-data.min.js 6:49:18 PM: at pp$4.raise (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:21435:13) 6:49:18 PM: at pp$9.unexpected (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:18643:8) 6:49:18 PM: at pp$5.parseIdentNode (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:21371:10) 6:49:18 PM: at pp$5.parseIdent (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:21344:19) 6:49:18 PM: at pp$5.parsePropertyName (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:21163:109) 6:49:18 PM: at pp$5.parseProperty (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:21086:8) 6:49:18 PM: at pp$5.parseObj (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:21049:21) 6:49:18 PM: at pp$5.parseExprAtom (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:20775:17) 6:49:18 PM: at pp$5.parseExprSubscripts (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:20583:19) 6:49:18 PM: at pp$5.parseMaybeUnary (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:20549:17) 6:49:18 PM: 6:49:18 PM: build.command failed
6:49:18 PM: Error message 6:49:18 PM: Command failed with exit code 1: CI= npm run build (https://ntl.fyi/exit-code-1) 6:49:18 PM: 6:49:18 PM: Error location 6:49:18 PM: In Build command from Netlify app: 6:49:18 PM: CI= npm run build 6:49:18 PM: 6:49:18 PM: Resolved config 6:49:18 PM: build: 6:49:18 PM: command: CI= npm run build 6:49:18 PM: commandOrigin: ui 6:49:18 PM: publish: /opt/build/repo/dist 6:49:18 PM: publishOrigin: ui 6:49:20 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 6:49:20 PM: Failing build: Failed to build site 6:49:20 PM: Finished processing build request in 24.511s
Node version: v18.15.0
package.json
For the Build command in Netlify, I have tried with CI= npm run build and npm run build , but did not work
vite.config.ts
Locally it works fine. Any suggestion on this
Thanks in advance 🤝