Skip to content

usage with nextjs12 + react18 #852

@softmarshmallow

Description

@softmarshmallow

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions