You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parcel instantiates the variable before accessing it.
😯 Current Behavior
Parcel produces code which crashes:
[05:04:44.592] ERROR (799877): Failed to load plugin /home/jb/workspace/github.com/board-bound/workspace/base/dist/index.cjs
[05:04:44.592] ERROR (799877): (0 , $2dc7d233ad759ad5$export$71511d61b312f219) is not a function
err: {
"type": "TypeError",
"message": "(0 , $2dc7d233ad759ad5$export$71511d61b312f219) is not a function",
"stack":
TypeError: (0 , $2dc7d233ad759ad5$export$71511d61b312f219) is not a function
at Object.<anonymous> (/home/jb/workspace/github.com/board-bound/workspace/base/dist/index.cjs:881:47)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
at Module.require (node:internal/modules/cjs/loader:1311:19)
at require (node:internal/modules/helpers:179:18)
at PluginManager.loadPluginWithRequireNoCache (/home/jb/workspace/github.com/board-bound/workspace/server/src/PluginManager.ts:115:20)
at PluginManager.loadPlugin (/home/jb/workspace/github.com/board-bound/workspace/server/src/PluginManager.ts:129:33)
at PluginManager.loadPlugins (/home/jb/workspace/github.com/board-bound/workspace/server/src/PluginManager.ts:174:18)
}
This is because in the loaded index.cjs on line 881 $2dc7d233ad759ad5$export$71511d61b312f219 is accessed:
If i apply any decorator, self made ones or a decorator from class-validator the build does this error. As soon as i comment out any decorators, the error also disappears.
🌍 Your Environment
Software
Version(s)
Parcel
2.12.0
Node
v20.18.0
pnpm
9.13.2
Operating System
linux/zorin/6.8.0
The text was updated successfully, but these errors were encountered:
🐛 bug report
Parcel builds code which accesses an variable before its instantiated.
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Parcel instantiates the variable before accessing it.
😯 Current Behavior
Parcel produces code which crashes:
This is because in the loaded
index.cjs
on line 881$2dc7d233ad759ad5$export$71511d61b312f219
is accessed:Even tho its declared only after line 1962:
💁 Possible Solution
If i manually move the statement right before its accessed, the code works as expected.
🔦 Context
Cant use
class-validator
because of this issue.💻 Code Sample
This is the code triggering this state:
If i apply any decorator, self made ones or a decorator from
class-validator
the build does this error. As soon as i comment out any decorators, the error also disappears.🌍 Your Environment
The text was updated successfully, but these errors were encountered: