Skip to content

ReferenceError: self is not defined #59

Description

@jeanbenoit-richez

Hi,
The bundling is going good, i got my three: cjs, umd and esm bundle's file.
But when i'm trying to load my app with next.js I got this error:
"ReferenceError: self is not defined".

Next.js seems to load the common-js package on server.
The error is coming from the way webpack is loaded in the bundle itself:
Capture d’écran 2024-03-08 à 17 20 38

I tried everything available online.
Adding:

new webpack.ProvidePlugin({
      self: 'self',
}),

But still not working...
Do you think the problem is coming from webpack directly or from the way you used it in the library ?
Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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