I'm currently immersed in a project using three.js with the assistance of the parcel bundler.
Everything seems to be functioning perfectly on my local setup. However, upon attempting to deploy it on Netlify, I encounter the following error:
Uncaught ReferenceError: i is not defined at app.js:45:16
The section of code in app.js at line 45 reads as follows:
/*41*/ const particlesGeo = new THREE.BufferGeometry();
/*42*/ const particlesMat = new THREE.PointsMaterial({
/*43*/ size: 0.01,
/*44*/ map: loader.load(sparkleTexture),
/*45*/ transparent: true,
/*46*/ });
Surge deployment appears to function without any issues, so what could be causing this problem specifically on Netlify?
Netlify build settings:
https://i.sstatic.net/uHsNTm.png
package.json:
{
"name": "particle-system",
"version": "1.0.0",
"description": "",
"source": "src/index.html", // Added due to parcel error in netlify production
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"gsap": "^3.11.3",
"parcel": "^2.7.0",
"three": "^0.145.0"
}
}
Links:
- netlify deployment link
- github repository