Skip to content

Cannot use import statement outside a module #51

@RobEasthope

Description

@RobEasthope

Describe the bug

When adding the latexPlugin to the sanity config the Remix Vite app (v.2.12.1) refuses to compile the code giving the following Cannot use import statement outside a module error:

image

To Reproduce

Steps to reproduce the behavior:

  1. Install the plugin (I'm using pnpm if it makes any difference)
  2. Add the latexPlugin() to sanity.config.ts
  3. Spin up the app in dev mode to see the error

Expected behavior

The code compiles correctly

Which versions of Sanity are you using?

@sanity/cli (global)        3.52.2 (latest: 3.60.0)
@sanity/asset-utils          1.3.0 (latest: 2.0.6)
@sanity/icons                3.4.0 (up to date)
@sanity/image-url            1.0.2 (up to date)
@sanity/preview-url-secret  1.6.20 (latest: 1.6.21)
@sanity/react-loader        1.10.6 (latest: 1.10.7)
@sanity/schema              3.56.0 (latest: 3.60.0)
@sanity/ui                   2.8.9 (up to date)
@sanity/vision              3.56.0 (latest: 3.60.0)
@sanity/visual-editing       2.1.9 (latest: 2.1.10)
sanity  

What operating system are you using?
MacOS Sequoia 15.0 (24A335)

Which versions of Node.js / npm are you running?
v21.5.0

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