react icon indicating copy to clipboard operation
react copied to clipboard

Getting Uncaught SyntaxError: Unexpected template string on production build with NextJS

Open mhroes9627 opened this issue 3 years ago • 3 comments

Currently using NextJS for frontend and turborepo

Console error

Uncaught SyntaxError: Unexpected template string (at _app-f54835a384f76a9d.js:15:3257677)

Source is definitely pointing to the library's dist files image

mhroes9627 avatar Apr 21 '22 02:04 mhroes9627

hey @mhroes9627 thanks for reporting this!

Could you provide some additional information for us to be able to reproduce this, specifically your:

  • nextjs version
  • react version
  • @thirdweb-dev/sdk version
  • @thirdweb-dev/react version
  • any config / files difference from a basic next.js installation

Even more helpful if you could provide a github repo or code sandbox that has this issue that we can clone and investigate.

jnsdls avatar Apr 21 '22 19:04 jnsdls

Hey @jnsdls, thank you for taking the time to respond! I was able to fix the issue on our end by setting this config

swcMinify: false,

under this file So setting swcMinify to true produces the same error.

mhroes9627 avatar Apr 23 '22 05:04 mhroes9627

Hey @jnsdls, thank you for taking the time to respond! I was able to fix the issue on our end by setting this config

swcMinify: false,

under this file So setting swcMinify to true produces the same error.

thanks for the update, I'll try to reproduce the setup with turborepo and our starter project to try to fix the underlying bug.

Glad that you found a workaround for now!

jnsdls avatar Apr 23 '22 06:04 jnsdls