Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh default project fails to build #4210

Closed
Foobartender opened this issue Jun 29, 2019 · 9 comments
Closed

Fresh default project fails to build #4210

Foobartender opened this issue Jun 29, 2019 · 9 comments

Comments

@Foobartender
Copy link

Version

3.8.4

Environment info

  System:
    OS: Linux 5.1 Arch Linux undefined
    CPU: (8) x64 Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz
  Binaries:
    Node: 11.15.0 - /usr/bin/node
    Yarn: 1.16.0 - /usr/bin/yarn
    npm: 6.9.2 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 67.0.4
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 
    @vue/babel-preset-app:  3.8.0 
    @vue/babel-preset-jsx:  1.0.0 
    @vue/babel-sugar-functional-vue:  1.0.0 
    @vue/babel-sugar-inject-h:  1.0.0 
    @vue/babel-sugar-v-model:  1.0.0 
    @vue/babel-sugar-v-on:  1.0.0 
    @vue/cli-overlay:  3.8.0 
    @vue/cli-plugin-babel: ^3.8.0 => 3.8.0 
    @vue/cli-plugin-eslint: ^3.8.0 => 3.8.0 
    @vue/cli-service: ^3.8.0 => 3.8.4 
    @vue/cli-shared-utils:  3.8.0 
    @vue/component-compiler-utils:  2.6.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1)
    vue: ^2.6.10 => 2.6.10 
    vue-eslint-parser:  2.0.3 (5.0.0)
    vue-hot-reload-api:  2.3.3 
    vue-loader:  15.7.0 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 3.8.4

Steps to reproduce

  • vue create foo (use default options)
  • cd foo
  • npm run build

What is expected?

Successful build.

What is actually happening?

SourceMap error, build hangs.


Dropping in a package-lock.json from yesterday fixed it.

@fisherandrewbiz
Copy link

I am experiencing this same issue as of today.

When running npm run build on my Vue project, I receive the following error:

Unhandled rejection 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.

And then the build hangs.

@Dmajster
Copy link

experiencing this issue as well.

@garotosopa
Copy link

garotosopa commented Jun 29, 2019

I'm experiencing the same problem:

$ npm run build

> foo@0.1.0 build /tmp/foo
> vue-cli-service build

⠙  Building for production...Unhandled rejection 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] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:276:15)
    at SourceMapGenerator_addMapping [as addMapping] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:110:12)
    at /tmp/foo/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] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:157:14)
    at Function.SourceMapGenerator_fromSourceMap [as fromSourceMap] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:48:24)
    at SourceMapSource.node (/tmp/foo/node_modules/webpack-sources/lib/SourceMapSource.js:32:35)
    at SourceMapSource.proto.sourceAndMap (/tmp/foo/node_modules/webpack-sources/lib/SourceAndMapMixin.js:30:18)
    at getTaskForFile (/tmp/foo/node_modules/webpack/lib/SourceMapDevToolPlugin.js:37:30)
    at files.forEach (/tmp/foo/node_modules/webpack/lib/SourceMapDevToolPlugin.js:136:20)
    at Array.forEach (<anonymous>)
    at compilation.hooks.afterOptimizeChunkAssets.tap (/tmp/foo/node_modules/webpack/lib/SourceMapDevToolPlugin.js:130:12)
    at SyncHook.eval [as call] (eval at create (/tmp/foo/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at SyncHook.lazyCompileHook (/tmp/foo/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeChunkAssets.callAsync.err (/tmp/foo/node_modules/webpack/lib/Compilation.js:1313:42)
    at _err0 (eval at create (/tmp/foo/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)

⠇  Building for production...^C
$ node --version
v10.16.0
$ npm --version
6.9.2

For the time being, I disabled source maps as a workaround to get the project built:

vue.config.js

module.exports = {
    productionSourceMap: false
};

@TimTCrouch
Copy link

TimTCrouch commented Jun 30, 2019

I am experiencing the same problem. It happens with out-of-the-box projects created with both Babel or Typescript. Create the project. Change to folder and npm run build. Gets the error.

EDIT: I have also uninstalled Vue-CLI and gone back and tried each past release going back to 3.7.0, and I am getting the same error on each one. It seems highly unlikely that such a major issue would have slipped through the cracks, so I am not sure where this issue is coming from. Or if perhaps something on my machine is causing the issue?

@Foobartender
Copy link
Author

@TimTCrouch

No, it's not your machine.

The following is just a guess, because I'm not very familiar with Node.js.

The issue is probably caused by a breaking change or bug in a new version of a third-party dependency that was just released. NPM dependency management pulls in the latest version of the dependency, no matter which Vue CLI version you are installing.

If it's a breaking change, Vue CLI will have to adapt to that change. If it's a bug it will probably fix itself with an update of the dependency. As a temporary fix Vue CLI could declare the dependency with a version restriction.

Package-lock.json affects dependency resolution. Now I really don't know anything about that, but I think existing projects might be unaffected even if they update Vue CLI.

@haoqunjiang
Copy link
Member

A bug in terser 4.0.1 which was released hours ago.
For npm users: run npm i terser@4.0.0
For yarn users: add the following field to package.json and then rerun yarn:

"resolutions": {
  "terser": "4.0.0"
}

@michaelmanteo
Copy link

I'm experiencing the same problem:

$ npm run build

> foo@0.1.0 build /tmp/foo
> vue-cli-service build

⠙  Building for production...Unhandled rejection 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] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:276:15)
    at SourceMapGenerator_addMapping [as addMapping] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:110:12)
    at /tmp/foo/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] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:157:14)
    at Function.SourceMapGenerator_fromSourceMap [as fromSourceMap] (/tmp/foo/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:48:24)
    at SourceMapSource.node (/tmp/foo/node_modules/webpack-sources/lib/SourceMapSource.js:32:35)
    at SourceMapSource.proto.sourceAndMap (/tmp/foo/node_modules/webpack-sources/lib/SourceAndMapMixin.js:30:18)
    at getTaskForFile (/tmp/foo/node_modules/webpack/lib/SourceMapDevToolPlugin.js:37:30)
    at files.forEach (/tmp/foo/node_modules/webpack/lib/SourceMapDevToolPlugin.js:136:20)
    at Array.forEach (<anonymous>)
    at compilation.hooks.afterOptimizeChunkAssets.tap (/tmp/foo/node_modules/webpack/lib/SourceMapDevToolPlugin.js:130:12)
    at SyncHook.eval [as call] (eval at create (/tmp/foo/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at SyncHook.lazyCompileHook (/tmp/foo/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeChunkAssets.callAsync.err (/tmp/foo/node_modules/webpack/lib/Compilation.js:1313:42)
    at _err0 (eval at create (/tmp/foo/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)

⠇  Building for production...^C
$ node --version
v10.16.0
$ npm --version
6.9.2

For the time being, I disabled source maps as a workaround to get the project built:

vue.config.js

module.exports = {
    productionSourceMap: false
};

This worked as a solution to the issue! Thanks!

@haoqunjiang
Copy link
Member

Fixed in terser 4.0.2

dominikstraessle added a commit to jmp-app/jmp that referenced this issue Jul 1, 2019
dominikstraessle added a commit to jmp-app/jmp that referenced this issue Jul 1, 2019
* WIP: Improve event type detail view

* Try the custom option requests again

* Add checkbox to load elapsed events on EventOverview

* Add terser version to javascript dependencies to fix build error.
More information: https://stackoverflow.com/questions/56820768/unhandled-rejection-error-when-building-vue-js-project

* Add terser version to javascript dependencies to fix build error.
More information: https://stackoverflow.com/questions/56820768/unhandled-rejection-error-when-building-vue-js-project

* Add terser version to javascript dependencies to fix build error.
More information: https://stackoverflow.com/questions/56820768/unhandled-rejection-error-when-building-vue-js-project

* Terser Bug seems to be fixed in version 4.0.2
Read more: vuejs/vue-cli#4210 (comment)
jsmnbom added a commit to jsmnbom/mommys-cookbook-old that referenced this issue Jul 12, 2019
@0x8f701
Copy link

0x8f701 commented Apr 2, 2020

still this error... I tried to add resolutions but it doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants