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

frontend: Module parse failed: Unexpected character '@' (1:0) #2

Open
ltfschoen opened this issue Apr 25, 2024 · 0 comments
Open

frontend: Module parse failed: Unexpected character '@' (1:0) #2

ltfschoen opened this issue Apr 25, 2024 · 0 comments

Comments

@ltfschoen
Copy link

ltfschoen commented Apr 25, 2024

if you choose to add tailwind when generating the frontend, then when you run the frontend with yarn start:frontend i got error frontend: Module parse failed: Unexpected character '@' (1:0)

it required removing the line "next-transpile-modules": "^10.0.1", from package.json as suggested here tailwindlabs/tailwindcss#11229 since its a deprecated package as mentioned here https://www.npmjs.com/package/next-transpile-modules

but it was also necessary to follow the Migration Guide mentioned here https://github.com/martpie/next-transpile-modules/releases/tag/the-end, for example i had to change my next.config.js file from:

const withPlugins = require("next-compose-plugins")
const withTM = require("next-transpile-modules")(["@nextjs-lerna/shared"])
const withImages = require("next-images")
module.exports = withPlugins([withTM(), withImages], {
  webpack: (config) => {
    return config
  },
  images: {},
})

to instead be:

const withPlugins = require("next-compose-plugins")
const withImages = require("next-images")
module.exports = withPlugins([{transpilePackages: ['my-awesome-package']}, withImages], {
  webpack: (config) => {
    return config
  },
  images: {},
})

then it finally compiled my frontend code :)

i published my working example based on this project here https://github.com/ltfschoen/nft-coretime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant