Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build fails with "fetch" is not exported by "__marko-run__router.js" #108

Closed
pwhe23 opened this issue Jan 31, 2025 · 1 comment · Fixed by #109
Closed

npm run build fails with "fetch" is not exported by "__marko-run__router.js" #108

pwhe23 opened this issue Jan 31, 2025 · 1 comment · Fixed by #109

Comments

@pwhe23
Copy link

pwhe23 commented Jan 31, 2025

This is my first time trying out Marko and I really like what I see. The issue I'm running into is that I just create a new project:

npm init marko -- -t basic
npm run dev

and everything works as expected. However, when running

npm run build

I immediately see this error:

c:\Data\Code\marko3\marko4>npm run build

> [email protected] build
> marko-run build

x Build failed in 78ms
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

../../../../../C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/default-entry.mjs (2:9): "fetch" is not exported by "__marko-run__router.js", imported by "../../../../../C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/default-entry.mjs".
file: C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/default-entry.mjs:2:9

1: import { createMiddleware } from "@marko/run/adapter/middleware";
2: import { fetch } from "@marko/run/router";
            ^
3: import compression from "compression";
4: import { createServer } from "http";

    at getRollupError (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.error (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:15715:16)
    at Module.traceVariable (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:16164:29)
    at ModuleScope.findVariable (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:13886:39)
    at Identifier.bind (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:5088:40)
    at CallExpression.bind (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:2671:28)
    at CallExpression.bind (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:11312:15)
    at VariableDeclarator.bind (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:2675:23)
    at VariableDeclaration.bind (file:///c:/Data/Code/marko3/marko4/node_modules/rollup/dist/es/shared/node-entry.js:2671:28) {
  binding: 'fetch',
  code: 'MISSING_EXPORT',
  exporter: 'c:\\Data\\Code\\marko3\\marko4\\__marko-run__router.js',
  id: 'C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/default-entry.mjs',
  url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module',
  pos: 75,
  loc: {
    column: 9,
    file: 'C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/default-entry.mjs',
    line: 2
  },
  frame: '1: import { createMiddleware } from "@marko/run/adapter/middleware";\n' +
    '2: import { fetch } from "@marko/run/router";\n' +
    '            ^\n' +
    '3: import compression from "compression";\n' +
    '4: import { createServer } from "http";',
  watchFiles: [
    'C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/default-entry.mjs',
    'C:/Data/Code/marko3/marko4/node_modules/@marko/run/dist/adapter/middleware.js'
  ],
  [Symbol(augmented)]: true
}

Node.js v20.12.2

Maybe the problem is with Windows?

@DylanPiercey
Copy link
Contributor

@pwhe23 thanks for the report, looks like a windows related regression. We'll take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants