Skip to content

index.js is treated as an ES module file as it is a .js file #16

@Dev-Akash

Description

@Dev-Akash

ReferenceError: require is not defined in ES module scope, you can use import instead
--
This file is being treated as an ES module because it has a '.js' file extension and '/vercel/path0/node_modules/react-share-kit/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

So this is the error coming while implementing in next js application.
On my local have removed the "type": "module " line from package.json

Please let me know if this can be resolved as on deploying it is giving issue.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions