question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Rollup: Unexpected character '#'

See original GitHub issue

Rollup throws this error:

SyntaxError: Unexpected character '#' (67:2) in [redacted]\node_modules\dog\index.js

It seems to be caused by hashtag-prefixed members in the class, in index.js:

 // src/group.ts
 var Group = class {
  #child; // <------ THIS LINE
  #mapping;
  #kids;
  #sorted;
  #current;
  constructor(state, env) {
    this.uid = state.id.toString();
    this.#mapping = new Map();
    this.#kids = new Map();
    this.#sorted = [];
    let refs = this.link(env);
    this.#child = refs.child;
  }
  receive(req) {
    return abort(404);
  }

Any idea how to make it work with Rollup? I can’t seem to find a straightforward solution on Google too. The example from this repo is not bundling the worker through Webpack or Rollup.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rennokkicommented, Mar 30, 2022

Can’t remember why I needed the nodeGlobals(), perhaps to access the process constant. I didn’t actually need it in the project after all. 😅

Anyway, great package. It was easy to implement and wanted to build myself one, now we know who codes faster. 😄

1reaction
lukeedcommented, Mar 30, 2022

Ah, nice find! I think you should only need rollup-plugin-node-polyfills – although it’d be better to find/update dependencies that don’t need Node internals at all!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected character '@' (Note that you need plugins to ...
When I use Scss in rollup, and When I build project then there is a error: [!] Error: Unexpected character '@' (Note that...
Read more >
@rollup/plugin-typescript - npm
Start using @rollup/plugin-typescript in your project by running `npm i ... Error: Unexpected token (Note that you need plugins to import ...
Read more >
rollup 打包build报错:[!] Error: Unexpected character '@' (Note ...
Error : Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)styles\index.scss (1:0)1: @import '.
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >
Discussion on: How to Build A React TS Tailwind Design System
Error : Unexpected character '@' (Note that you need plugins to import ... I'm currently using the tsdx + tailwind + rollup-plugin-postcss + ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found