ebeaufay / threedtiles

3DTiles viewer for three.js
MIT License
270 stars 32 forks source link

Uncaught ReferenceError: regeneratorRuntime is not defined #2

Closed fanfafafanfan closed 2 years ago

fanfafafanfan commented 3 years ago

index.js:13501 Uncaught ReferenceError: regeneratorRuntime is not defined at index.js:13501 at index.js:13501 at Module../node_modules/_three@0.130.1@three/build/three.module.js (index.js:13512) at webpack_require (bootstrap:789) at fn (bootstrap:100) at Module../src/index.js (index.js:1) at webpack_require (bootstrap:789) at fn (bootstrap:100) at Object.0 (tileset.js:213) at __webpack_require__ (bootstrap:789)

I searched for solutions: npm i --save-dev babel-runtime babel-plugin-transform-runtime then Configure in .babelrc: plugins:["tranform-runtime"]

It doesn't work

tomatofall commented 3 years ago

In package.json "plugins": [          "@babel/plugin-transform-runtime"      ]

In webpack.config.js entry: ["regenerator-runtime/runtime.js",'./src/index.js'],

ebeaufay commented 3 years ago

Hi,

This is caused by a dependency order issue.

In the main.js file, you need to move the regeneratorRuntime import up.

Not sure what's causing this but I'm guessing it's linked to the webpack version.

Sincerely,

Emeric Beaufays

On Thu, Sep 16, 2021, 06:49 tomatofall @.***> wrote:

In package.json "plugins": [ @.***/plugin-transform-runtime" ]

In webpack.config.js entry: ["regenerator-runtime/runtime.js",'./src/index.js'],

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ebeaufay/3DTilesViewer/issues/2#issuecomment-920572513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBD5DDGF56KCD3ALHPLFC3UCFZL5ANCNFSM5AAKAU2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.