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] build with Nextjs, error 'Uncaught SyntaxError: Unexpected template string' occurs

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.2.15

Current Behavior

Demo repo:

https://github.com/liran319/next-wagmi-demo

I have install wagmi@0.2.15 into my project with Nextjs, it works well when start project with ‘yarn dev’. But Uncaught SyntaxError: Unexpected template string occurs when run ‘yarn build && yarn start’. image

It seems that only occurs on production mode.And there is no stack to debug. Could you please have a check?

Expected Behavior

Both development and production mode work well.

Steps To Reproduce

  1. Clone the repo https://github.com/liran319/next-wagmi-demo, and enter that folder;
  2. Run yarn to install deps;
  3. Run ‘yarn build && yarn start’
  4. check console, found ‘Uncaught SyntaxError: Unexpected template string’, and button doesn’t work

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ranlixcommented, Feb 23, 2022

OH yes, it is! It works! But I think there is some where can be optimized and fixed on wagmi.

Thanks you very much!

0reactions
tmmcommented, Apr 4, 2022

@liran319 this appears to be an issue with next’s SWC minification. You can add feedback to this discussion https://github.com/vercel/next.js/discussions/30237

the other issue brought up in the thread is related to es6 private fields. that is now fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] build with Nextjs, error 'Uncaught SyntaxError ... - GitHub
But Uncaught SyntaxError: Unexpected template string occurs when run 'yarn build && yarn start'. image. It seems that only occurs on production ...
Read more >
Why do I get an unexpected template string expression error?
This is an warning generated by ESLint: no-template-curly-in-string. Disallow template literal placeholder syntax in regular strings ...
Read more >
react-hydration-error - Next.js
The first render is called Hydration which is a feature of React. This can cause the React tree to be out of sync...
Read more >
Uncaught SyntaxError: Unexpected token < - JavaScript - iDiallo
This is a common error in JavaScript, and it is hard to understand at first why it happens. But if you bear with...
Read more >
Node.js v19.3.0 Documentation
Indicates the failure of an assertion. All errors thrown by the node:assert module will be instances of the AssertionError class. new assert.AssertionError( ...
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