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

Unable to serve express application #16977

Closed
1 of 4 tasks
kalingaCoder opened this issue May 12, 2023 · 3 comments
Closed
1 of 4 tasks

Unable to serve express application #16977

kalingaCoder opened this issue May 12, 2023 · 3 comments

Comments

@kalingaCoder
Copy link

kalingaCoder commented May 12, 2023

Current Behavior

When running nx serve server which is Express application, getting error
https://stackblitz.com/edit/react-ts-yza5hs?file=README.md

Expected Behavior

Should be able to serve the server app
should be able to open in the browser

GitHub Repo

https://github.com/kalingaCoder/NX16

Steps to Reproduce

  1. npm install
  2. run npm run svr

The server application was created using
npx nx generate @nx/express:application server--directory=./ --babelJest --frontendProject=sg --no-interactive

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 18.12.0
   OS     : win32 x64
   npm    : 8.19.2
   Hasher : Native

   nx                 : 16.1.4
   @nx/js             : 16.1.4
   @nx/jest           : 16.1.4
   @nx/linter         : 16.1.4
   @nx/workspace      : 16.1.4
   @nx/cypress        : 16.1.4
   @nx/devkit         : 16.1.4
   @nx/eslint-plugin  : 16.1.4
   @nx/express        : 16.1.4
   @nx/node           : 16.1.4
   @nx/react          : 16.1.4
   @nrwl/tao          : 16.1.4
   @nx/vite           : 16.1.4
   @nx/web            : 16.1.4
   @nx/webpack        : 16.1.4
   typescript         : 5.0.4

Failure Logs

Error: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths 
must be valid file:// URLs. Received protocol 'd:'
    at new NodeError (node:internal/errors:393:5)
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1026:11)
    at defaultResolve (node:internal/modules/esm/resolve:1106:3)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:525:22)
    at importModuleDynamically (node:internal/modules/cjs/loader:1098:29)
    at importModuleDynamicallyWrapper (node:internal/vm/module:438:21)
    at importModuleDynamically (node:vm:389:46)

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I tried creating express applications with multiple approaches, but no luck

@AdditionAddict
Copy link

Duplicate of #16834 (patched)

downgrade to 16.1.0 or wait for next release

@kalingaCoder
Copy link
Author

Its resolved after downgrading to 16.0.3. Will try with 16.1.0

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants