Closed mudiagauwojeya closed 11 months ago
Hm that's odd that it works on 1.0.14, because nothing in the build has changed. This package has always just exported as ESM. What NextJS version do you use? Think this is a similar problem -> https://stackoverflow.com/questions/66244968/cannot-use-import-statement-outside-a-module-error-when-importing-react-hook-m
Hm that's odd that it works on 1.0.14, because nothing in the build has changed. This package has always just exported as ESM. What NextJS version do you use? Think this is a similar problem -> https://stackoverflow.com/questions/66244968/cannot-use-import-statement-outside-a-module-error-when-importing-react-hook-m
next: 13.1.6
Perhaps, it is not this package that is the problem but my switching package manager from yarn to bun. After I opened this issue, another package react-mentions
also started to break my production build.
This fixed it for me:
// next.config.mjs
const nextConfig = {
transpilePackages: ['react-ts-tradingview-widgets'],
}
export default nextConfig
@mdatsev thanks, it worked
Also thanks @JorrinKievit for creating this repo
Thank you for this package. I have been using it for a client's project since January. However, a few days ago my deployment failed after I switched from yarn to bun as a package manager. At that time, my version of react-ts-tradingview-widgets was upgraded from 1.0.14 to 1.2.0. As a result, I keep the getting this error when I run build locally or on production:
After rolling back to version 1.0.14, my build was successful.