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

usage with nextjs12 + react18 #852

Open
softmarshmallow opened this issue May 16, 2022 · 0 comments
Open

usage with nextjs12 + react18 #852

softmarshmallow opened this issue May 16, 2022 · 0 comments

Comments

@softmarshmallow
Copy link

softmarshmallow commented May 16, 2022

I struggled a bit to use this package with nextjs12 and react18.

Here is the solution for the future reference.

in next.config.js

const withTM = require("next-transpile-modules")([
    ....
    // https://github.com/vercel/next.js/discussions/13553#discussioncomment-20092  ----------------------------
    // cause of this, we also set `experimental: { esmExternals: "loose" }`
    "react-tag-input",
    "react-dnd",
    "dnd-core",
    "@react-dnd/invariant",
    "@react-dnd/asap",
    "@react-dnd/shallowequal",
    //  --------------------------------------------------------------------------------------------------------
    ....
])

module.exports = withTM({
    experimental: { esmExternals: "loose" },
})

ref:

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