blake-regalia / graphy.js

A collection of RDF libraries for JavaScript
https://graphy.link/
ISC License
161 stars 3 forks source link

4.3.4 breaks build with webpack #49

Closed abeforgit closed 2 years ago

abeforgit commented 2 years ago

I honestly have no idea how this is possible looking through the commit diffs, but our builds break when using 4.3.4, but work fine with 4.3.3. The error we get is the following:

Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /app/node_modules/@graphy/memory.dataset.fast/main.js: The only valid numeric escape in strict mode is '\0'. (698:25)

  696 |
  697 |                         // create norm string
> 698 |                         const s_norm_g = '_:a\9';
      |                                               ^
  699 |
  700 |                         // each subject
  701 |                         for(const sc1_subject of hc3_trips) {
    at Parser._raise (/app/node_modules/@babel/parser/lib/index.js:541:17)
    at Parser.raiseWithData (/app/node_modules/@babel/parser/lib/index.js:534:17)
    at Parser.raise (/app/node_modules/@babel/parser/lib/index.js:495:17)
    at Parser.recordStrictModeErrors (/app/node_modules/@babel/parser/lib/index.js:3023:12)
    at Parser.readEscapedChar (/app/node_modules/@babel/parser/lib/index.js:3083:16)
    at Parser.readString (/app/node_modules/@babel/parser/lib/index.js:2935:21)
    at Parser.getTokenFromCode (/app/node_modules/@babel/parser/lib/index.js:2575:14)
    at Parser.nextToken (/app/node_modules/@babel/parser/lib/index.js:2016:12)
    at Parser.next (/app/node_modules/@babel/parser/lib/index.js:1922:10)
    at Parser.eat (/app/node_modules/@babel/parser/lib/index.js:1927:12)
 @ ../tmp/broccoli-1cEhEfYwj3HF9/cache-480-webpack_bundler_ember_auto_import_webpack/app.js 19:61-99

webpack 5.55.1 compiled with 1 error in 6858 ms⠋ building... [ember-auto-import-we
Build Error (WebpackBundler)

tldr: the \9 escape sequence is not supported in strict mode. I think our babel/webpack setup inserts strict mode somewhere down the pipeline.

I admit our build process is a little niche, the emberjs framework we use doesn't have the cleanest webpack integrations (yet), but it's strange that v4.3.3 worked perfectly and 4.3.4 errors out, given that the diff is so small.

tpluscode commented 2 years ago

Oh, this looks similar to #55

Try downgrading to node v14 for now

blake-regalia commented 2 years ago

Fixed in v4.3.5 (affected packages only)