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

Module parse failed: Identifier '_templateObject' has already been declared #249

Open
Lee-Jason-Curley opened this issue Dec 20, 2023 · 5 comments

Comments

@Lee-Jason-Curley
Copy link

Lee-Jason-Curley commented Dec 20, 2023

Issue description or question

I can't run Console Ninja without running into this issue outlined in Stackoverflow post:
https://stackoverflow.com/questions/74834358/module-parse-failed-identifier-templateobject-has-already-been-declared

Please note that this has been viewed by 1000+ times. So, it seems to be a persistent issue. My app is using node 18.14.0.

Is there going to be fix anytime soon? As is, Console Ninja is unusable for me. I'm using v1.0.268.

Wallaby diagnostics report

@ArtemGovorov
Copy link
Member

ArtemGovorov commented Dec 20, 2023

We have seen an issue like this before and it was related to Next.js SWC compilation: vercel/next.js#44113. We have added a fix for it in Console Ninja when it was originally reported.

Something must have changed in Next.js since then, so the issue is back and new fix may be required.

Unfortunately, we can't reproduce the issue in a freshly generated npx create-next-app@latest Next.js app. It's possible that some specific next.js setting or dependency of your app is causing it.

Can you please create a sample repo demonstrating the issue, we are happy to take a look and investigate.

@ArtemGovorov ArtemGovorov transferred this issue from wallabyjs/public Dec 20, 2023
xuxucode added a commit to xuxucode/console-ninja-issue-249 that referenced this issue Jan 18, 2024
@xuxucode
Copy link

See sample repo: https://github.com/xuxucode/console-ninja-issue-249/blob/master/app/page.tsx#L12-L14

The critical part is a class with private methods:

// A class with two private methods which have same names. The only difference
// is one of them begins with a underscore.
class Client {
  #privateMethod() { }

  #_privateMethod() { }
}

@smcenlly
Copy link
Member

@xuxucode - We can reproduce the same issue in your sample repo with Console Ninja paused, disabled, and when Console Ninja is not installed. The problem in your sample repo is not a problem with Console Ninja, it looks to be a problem with Next.js compilation.

@xuxucode
Copy link

@smcenlly Yes, it is related to Next.js, has nothing to do with Console Ninja.

@xuxucode
Copy link

I also post the comment at vercel/next.js#44113 (comment), maybe it should be fixed there.

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

4 participants