Parcel: Unterminated regular expression (sourcemap)

Created on 14 Mar 2019  路  6Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

I am trying to compile vue components using parcel. The build is not working correctly. I am getting the error mentioned below.

馃帥 Configuration (.babelrc, package.json, cli command)

no configs

馃 Expected Behavior

Build without any errors

馃槸 Current Behavior

Getting the following error

Could not load existing sourcemap of "../node_modules/vue-runtime-helpers/dist/inject-style/browser.js".
脳  \node_modules\vue-runtime-helpers\dist\inject-style\browser.js:28:86: Unterminated regular expression (28:86)
  26 |       code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875
  27 |
> 28 |       code += '\n + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';
     |                                                                                      ^
  29 |     }
  30 |
  31 |     if (!style.element) {

馃拋 Possible Solution

If i comment the code causing the error, it works without any problems. But it affects the source maps.

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.2 (global mode)
| Node | v10.14.2
| npm/Yarn | v6.4.1
| Operating System | Windows 10

Bug

Most helpful comment

same issue here

All 6 comments

This is a known issue, duplicate of https://github.com/parcel-bundler/parcel/issues/2408 (there's even a PR open to solve this: #2427)

@mischnic Is there a solution for this yet?

Is there a solution for this yet?

That PR will solve this, I don't know of any workarounds apart from the one you mentioned already (apart maybe from disabling source maps completely with --no-source-maps).

@mischnic Thanks. It works without source maps. Hope you will fix the source map issues soon.

Is there any news on this? The same problem happens when using paper.js

same issue here

Was this page helpful?
0 / 5 - 0 ratings