Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

SyntaxError: Unexpected token 'export' from @stoplight/spectral-core #2850

@0thernet

Description

@0thernet

Describe the bug
Our CI builds started failing because optic run starting throwing a SyntaxError, seems like due to this issue:
stoplightio/spectral#2656

To Reproduce
Steps to reproduce the behavior:

  1. optic run <openapi.json>
  2. see this error
/Users/benguo/.nvm/versions/node/v18.18.2/lib/node_modules/@useoptic/optic/node_modules/@stoplight/json/index.js:1
export * from './bundle';
^^^^^^

SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1178:20)
    at Module._compile (node:internal/modules/cjs/loader:1220:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/Users/benguo/.nvm/versions/node/v18.18.2/lib/node_modules/@useoptic/optic/node_modules/@stoplight/spectral-core/dist/spectral.js:5:16)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)

Node.js v18.18.2

Expected behavior
Just started seeing this error in CI on our end with no changes.
Seems to be this issue, and spectral/stoplight needs to be pinned within Optic.
stoplightio/spectral#2656

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions