Parcel: SyntaxError: Invalid or unexpected token when importing a background image in SCSS

Created on 25 Jan 2018  路  3Comments  路  Source: parcel-bundler/parcel

Choose one: is this a 馃悰 bug report or 馃檵 feature request?
Bug

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

.Background {
  background: url('assets/bg.jpg');
}

馃 Expected Behavior

For it to work

馃槸 Current Behavior

Fails with a JS error SyntaxError: Invalid or unexpected token on the following line at the bottom:

},{"./bundle-url":15}],9:[function(require,module,exports) {

        var reloadCSS = require('_css_loader');
        module.hot.dispose(reloadCSS);
        module.hot.accept(reloadCSS);

},{"./assets/bg.jpg":[["4edb26dd740df8d2a3,17:[function(require,module,exports) {

The background image itself is displaying fine. It's just crashing all the JS due to this error.

馃捇 Code Sample

See above

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.5.0
| Node | 8.9.3
| npm/Yarn | Yarn, 1.3.2
| Operating System | OS X

Bug CSS Preprocessing Stale

Most helpful comment

I am seeing the same issue. Does Parcel allow linking to other html pages from the entry point with <a> tags?
Ex.: in index.html <a href="page2.html">Go to the next page</a>

All 3 comments

Additional information, this only started happening when I created a second HTML page, and linked to that second page from my first page. Once I removed that page it was back to working fine.

I am seeing the same issue. Does Parcel allow linking to other html pages from the entry point with <a> tags?
Ex.: in index.html <a href="page2.html">Go to the next page</a>

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings