Skip to content

Not working with SSR #29

Closed
Closed
@kije

Description

@kije

I'm trying to use this with Gatsby.js, but the problem is the UMD wrapper that is generated in the dist folder is referencing window, which breaks the build because window is not defined during SSR.

The best way to fix this/increase compatibility would be to generate builds for multiple targets (see https://medium.com/@kelin2025/so-you-wanna-use-es6-modules-714f48b3a953).

Another, quicker approach might be to include the src/ files in the npm package and reference the src/index.js via the "module" property in package.json

see also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions