question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Uncaught ReferenceError: d is not defined ...', Error with vue project 'npm run build'

See original GitHub issue
Description of the problem

Tthe latest version of OBJLoader2Parallel import { OBJLoader2Parallel } from 'three/examples/jsm/loaders/OBJLoader2Parallel.js' @vue/cli 4.1.1

when I run ‘npm run build’ to pack my project

Uncaught ReferenceError: d is not defined
    at DefaultWorkerPayloadHandler.handlePayload (a3ceb20b-b062-47b0-b0f2-38112620b4de:94)
    at WorkerRunner.processMessage (a3ceb20b-b062-47b0-b0f2-38112620b4de:113)
    at n (a3ceb20b-b062-47b0-b0f2-38112620b4de:100)

but in the dev environment(npm run server) was fine.

Three.js version
  • Dev
  • r112
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kaisalmencommented, Jan 9, 2020

I think I have a fix for CodeSerializer which resolves the issue globally. I will open a PR possibly later today and ask both of you to verify it then.

1reaction
kaisalmencommented, Jan 9, 2020

@cs64188 this and a regression @geoff-harper reported here #17769 have the same root cause. Independent of react and vue once the app gets build and uglified the CodeSerializer creates broken code for the worker as it expects the names of the classes/prototypes to be unchanged.

I will investigate whether this limitation can be removed…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue is not defined - javascript - Stack Overflow
First, when you import the vue.js script you use type="JavaScript" as content-type which is wrong. You should remove this type parameter ...
Read more >
Uncaught ReferenceError: Vue is not defined - Laracasts
I can't figure out why I'm getting this error app.js:1041 Uncaught ReferenceError: Vue is not defined at Object.VERSION (app.js:1041) at __webpack_require__ ...
Read more >
ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
ReferenceError is not defined errors in production but works in ...
I am quite new to vue.js, so I decided to start with the newest and greatest - Vue3, vite, script setup, etc. I...
Read more >
How To Fix ReferenceError require is not defined in JavaScript
json file for an property called type . If that is set to module , ES6 modules will be enabled and you will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found