14islands / r3f-scroll-rig

A react-three-fiber scroll-rig for syncing 3D meshes and DOM elements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

process is not defined

seantai opened this issue · comments

Uncaught ReferenceError: process is not defined

I've been trying to test this library but running into above error when I

any tips to move forward appreciated

Looks like the ESM bundle of this library is shipping CJS code untranspiled. This specific error comes from the entrypoint of React which is used to load the correct bundle. R3F also does this but has a separate ESM target, React does not.

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./cjs/react.production.min.js');
} else {
  module.exports = require('./cjs/react.development.js');
}

Looking into a fix, but I'd suggest this library use Vite which handles these kinds of headaches wonderfully.

Seems like it was an old prop-types import that was bundling in that process.env check.

I removed it and it seemed to have fixed the issue (and made the bundle smaller).

@seantai please try v8.9.2+

Closing due to inactivity