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

Most upvoted comments

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 use window || 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