sebastian-software / edge

The Lerna Repository for Edge Platform
Apache License 2.0
33 stars 7 forks source link

"build" of boilerplate code is not working #23

Closed fastner closed 6 years ago

fastner commented 6 years ago

There seems to be two issues with edge-boilerplate creating a production build.

  1. Only server (based on src/binary.js) is created, dependent main.js is not created when running npm run build
  2. Running edge build throws exception

When I get it right solution to (1) is to add edge build to scripts->build in package.json.

Exception thrown in (2):

EDGE v0.13.9 running on edge-boilerplate-0.7.12
CLIENT Configuration:
→ Environment: production
→ Webpack Target: web
✔ CLIENT Done!
edge-boilerplate: Compiled client successfully!
SERVER Configuration:
→ Environment: production
→ Webpack Target: node
⠹ SERVER Optimizing chunk assets/Users/bs5/Code/edge/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:276
        throw new Error(
        ^

Error: original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
    at SourceMapGenerator_validateMapping [as _validateMapping] (/Users/bs5/Code/edge/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:276:15)
    at SourceMapGenerator_addMapping [as addMapping] (/Users/bs5/Code/edge/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:110:12)
    at /Users/bs5/Code/edge/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:72:17
    at Array.forEach (<anonymous>)
    at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (/Users/bs5/Code/edge/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:157:14)
    at Function.SourceMapGenerator_fromSourceMap [as fromSourceMap] (/Users/bs5/Code/edge/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:48:24)
    at SourceMapSource.node (/Users/bs5/Code/edge/node_modules/webpack-sources/lib/SourceMapSource.js:32:35)
    at SourceMapSource.proto.sourceAndMap (/Users/bs5/Code/edge/node_modules/webpack-sources/lib/SourceAndMapMixin.js:30:18)
    at getTaskForFile (/Users/bs5/Code/edge/node_modules/webpack/lib/SourceMapDevToolPlugin.js:33:30)
    at chunk.files.forEach.file (/Users/bs5/Code/edge/node_modules/webpack/lib/SourceMapDevToolPlugin.js:91:21)
    at Array.forEach (<anonymous>)
    at /Users/bs5/Code/edge/node_modules/webpack/lib/SourceMapDevToolPlugin.js:89:18
    at Array.forEach (<anonymous>)
    at Compilation.<anonymous> (/Users/bs5/Code/edge/node_modules/webpack/lib/SourceMapDevToolPlugin.js:88:12)
    at Compilation.applyPlugins1 (/Users/bs5/Code/edge/node_modules/tapable/lib/Tapable.js:75:14)
    at applyPluginsAsync.err (/Users/bs5/Code/edge/node_modules/webpack/lib/Compilation.js:667:11)
swernerx commented 6 years ago

This seems to be related to the source map loading in Webpack which tries to load source maps delivered via e.g. packages in node_modules. There was such an error a few versions ago. Not sure which project/dependency is causing this now.

swernerx commented 6 years ago

I am able to reproduce the error.

BTW: The reason why "build" is not containing all is mainly related to the usage in "prepack" for publishing to npm.

swernerx commented 6 years ago

Fixed the exception with edge-builder@0.14.0 + revamped scripts section in boilerplate.