Skip to content

SyntaxError: Unexpected token ',' #9079

Open
@rolandleth

Description

@rolandleth

Reproduction

Sometimes I get this error for yarn dev or yarn remix vite:dev or yarn remix vite:dev --force even on the most basic project, for example with npx create-remix@latest --template remix-run/remix/templates/vite-express vite-template, without changing anything.

Even though there's nothing in the storage or cookies, if I open the app in a new tab, new window or a private window, or if I yarn build && yarn start, everything works. Later edit: it also happens in new tabs/windows.

This appears to only happen in Safari, Firefox and Chrome seem to never do this. Later edit, they do too.

I tried removing node_modules/.vite, yarn's cache and reinstalling packages.

As far as I can tell, this breaks/crashes the whole app, because when it works, I usually get the correct "vite connecting, vite connected" messages in the console.

Any tips, please?

Screenshot 2024-03-19 at 2 05 17 PM 2024-03-19 at 2 06 34 PM

The line with issues looks like "root" && window.__remixRouteModuleUpdates.set("root", nextExports); when it works.

System Info

System:
    OS: macOS 14.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 102.91 MB / 16.00 GB
    Shell: 3.6.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/node
    Yarn: 4.1.1 - /opt/homebrew/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v21.2.0/bin/npm
  Browsers:
    Chrome: 121.0.6167.160
    Safari: 17.4
  npmPackages:
    @remix-run/dev: ^2.8.1 => 2.8.1 
    @remix-run/express: ^2.8.1 => 2.8.1 
    @remix-run/node: ^2.8.1 => 2.8.1 
    @remix-run/react: ^2.8.1 => 2.8.1 
    vite: ^5.1.6 => 5.1.6

Used Package Manager

yarn

Expected Behavior

To work.

Actual Behavior

It doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions