Skip to content

Uncaught ReferenceError: window is not defined #1194

Closed
@octave

Description

@octave

When using @segment/[email protected] in a @shopify/[email protected] application, deploying fails after building with this error:

 Uncaught ReferenceError: window is not defined  
   at worker.mjs:5087:5433                                                  
   at worker.mjs:5087:17531   

After investigating the worker.mjs the issue seems to be coming from analytics.js-video-plugins that is being added at the end of the worker.mjs file, even though I only import AnalyticsBrowser:

import {AnalyticsBrowser} from '@segment/analytics-next';

It works fine in development but it fails to deploy. Is it possible to not have analytics.js-video-plugins added to the build?

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