standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

Syntax error on built loader #827

Closed Lcfvs closed 5 years ago

Lcfvs commented 5 years ago

Something wrong on package building.

OS: Windows 10 node version: v12.6.0 npm version: 6.9.0 esm version: 3.2.25 (@latest)

node_modules/esm/esm/loader.js:204

if (0 === this.prerelease.length) this.prerelease = [0] else {
jdalton commented 5 years ago

Hi @Lcfvs!

Do you mean something is wrong when building from the master branch of the standard-things/esm repo? Or is this related to a project where you're using esm as part of a build step?

Lcfvs commented 5 years ago

Hi @jdalton

I simply installed esm and used by node -r esm index.js, nothing exotic then. ;)

jdalton commented 5 years ago

Could you provide the index.js you're trying to run or better yet a simple repro repo with the exact config, package.json, etc. of your setup.

Lcfvs commented 5 years ago

Just made a gist, with the package.json, the fresh generated (install only, never ran) loader.js and a reformated version reformated-loader.js: https://gist.github.com/Lcfvs/a68a9c60a79e855874b86f9bf970c8a0#file-reformated-loader-js-L204

jdalton commented 5 years ago

Hmm. I cannot reproduce the error with our published package. Maybe some other process on your end has run over the file and caused it to be changed in some way.

Lcfvs commented 5 years ago

I don't see what process, it's a very new PC (just installed node, git, phpstorm, then npm i on my project.

Lcfvs commented 5 years ago

Hmmm, I don't know how you don't have the same thing on your end, that error is contained in your NPM tarball: npm pack esm.

Lcfvs commented 5 years ago

Ok, maybe a phpstorm eslint process, as suggested by @ljharb, sorry.