I'm puzzled by the error message I'm receiving:
[commonjs--resolver] Unexpected character '�' (Note that you need plugins to import files that are not JavaScript) file: /..../..../WebProjects/..../ProjectName/node_modules/fsevents/fsevents.js:1:0
on my VueJS web app. This error indicates that vite is having trouble building the fsevents.node
file located in the fsevents
folder within the node_modules directory.
I am unsure about how the fsevents package ended up installed; I don't remember installing it explicitly. I thought running npm explain fsevents might help identify which of my installed packages rely on fsevents
.
Examining my package.json, it doesn't seem too complex:
{
"name": "project-name",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/"
},
"dependencies": {
"@vitejs/plugin-basic-ssl": "^1.0.1",
"axios": "^1.5.1",
"bulma": "^0.9.4",
"chart.js": "^4.4.0",
"is-what": "^4.1.15",
"pinia": "^2.1.6",
"rollup": "^4.3.0",
"vite-plugin-vuetify": "^1.0.2",
"vue": "^3.3.4",
"vue-chartjs": "^5.2.0",
"vue-loading-overlay": "^6.0.3",
"vue-router": "^4.2.4",
"vue3-easy-data-table": "^1.5.47",
"vuetify": "^3.3.23"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.2",
"@tsconfig/node18": "^18.2.0",
"@types/node": "^18.18.5",
"@vitejs/plugin-vue": "^4.4.0",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.46.0",
"eslint-plugin-vue": "^9.16.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"sass": "^1.69.3",
"sass-loader": "^13.3.2",
"typescript": "~5.1.6",
"vite": "4.5.0",
"vite-plugin-native": "^0.2.0",
"vue-tsc": "^1.8.8"
}
}
I'm at a loss as to what could be causing this issue and what other troubleshooting steps I can take.