Skip to content

Still issues with broadcast-channel dependency and svelte-kit #45

Closed
@frederikhors

Description

@frederikhors

@amen-souissi @benmccann I tried 1.4.1 now.

We still have a problem with broadcast-channel if I remove these lines from svelte.config.js:

vite: {
  optimizeDeps: {
    include: ['broadcast-channel']
  },
}

This is the log:

1:22:06 AM [vite] Error when evaluating SSR module /node_modules/broadcast-channel/dist/es/method-chooser.js:
ReferenceError: require is not defined
    at eval (/node_modules/broadcast-channel/dist/es/method-chooser.js:26:20)
    at instantiateModule (C:\kit\node_modules\vite\dist\node\chunks\dep-e9a16784.js:68197:166)

Do you have any idea?

Maybe this is related to "type": "module" in package.json which is the default in a new SvelteKit project, right?

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