parcel: š `require is not defined`
Is that just me ? the simplest example does not even work; breaking on the very first variable in ./build/index.js :
"use strict";
require = function (_require) { etcā¦
Or transforms/babelization/etc⦠(not shown in the example) are to be added first ?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 38
- Comments: 25 (4 by maintainers)
Commits related to this issue
- Merged in fix-worker-importing-css (pull request #40) Quick fix for worker importing css files Approved-by: Will Binns-Smith Approved-by: Stacy London — committed to parcel-bundler/parcel by padmaia 4 years ago
- Merged in bdo/fix-manifest-reporter (pull request #40) Fix reporters Approved-by: Will Binns-Smith — committed to parcel-bundler/parcel by thebriando 3 years ago
I upgraded node v9.2.0 and solved it.
my node version is v6, this issue was be fixed after upgrade to v8
Looking forward to this fix pending (#253).
To the project maintainers: Having recently heard about Parcel and itās zero configuration feature, I was eager to try it out on a new project, but quickly found that the āGetting Startedā example just fails, which needless to say is not a good reflection upon this library. My suggestion (until this issue is fixed) would be for you to list the current limitation (requires nodeJS v > 6) on your README file and website.
Appreciate the work that has gone into this library and for the introduction of a zero config bundler. I will revisit this again in the futureā¦
Still getting the same issue.
Node version : 9.5.0 Parcel version : 1.5.1
Just have a button in my html page which on clicking calls the clickHandler function in the js file. Get an error saying āReferenceError: clickHandler is not definedā. I could find the function in the built js file under dist.
Note: have configured to use babel. But still⦠š
i try it, since v7.0.0 to v7.9.0, it cannot run, but when I use v8.0.0, it done !, so, I guess parcel need Node version is greater than or equal to v8.0.0
In strict or sloppy mode, you can always use
Function(āreturn thisā)()
in every engine except CSP-enabled browsers (however, for those, you can usewindow || self
.@phobal But what results to the problem, I would like to konw the explaniation. Itās all konwn that
require
is supported at the node @v6.x.x