Skip to content

SyntaxError: Invalid or unexpected token when running npm start:prod #7

@hanshuebner

Description

@hanshuebner

I had an issue with my version of the guide created from following the ❤️ excellent ❤️ "Getting Started" documentation, exposing itself as:

% pnpm start:prod

> @mikro-orm/getting-started@6.0.0 start:prod /Users/hans/Development/privat/mikro-orm-guide
> NODE_ENV=production node dist/server.js

[info] MikroORM version: 6.4.6
[discovery] ORM entity discovery started, using ReflectMetadataProvider
[discovery] - processing 6 files
SyntaxError: Invalid or unexpected token
    at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:106:18)
    at ModuleLoader.<anonymous> (node:internal/modules/esm/translators:549:10)
    at #translate (node:internal/modules/esm/loader:470:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:517:27)
    at async ModuleJob._link (node:internal/modules/esm/module_job:115:19)
(node:46890) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

I wanted to see whether the repository version of the sample application has the same issue, but before I could even run it, I ahd to update its dependencies because the committed version would not build on macOS 15.3. I made the changes as in this PR, and with those, the error above occurs in the repository version as well. Any ideas?

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