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

Error: Dynamic require of "*" is not supported #16036

Closed
whalemare opened this issue Apr 1, 2023 · 1 comment · Fixed by #10414
Closed

Error: Dynamic require of "*" is not supported #16036

whalemare opened this issue Apr 1, 2023 · 1 comment · Fixed by #10414
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx type: bug

Comments

@whalemare
Copy link

whalemare commented Apr 1, 2023

Current Behavior

When I build my node app as esm module, it unable to run with node, because of following error:

file:///Users/whalemare/ts-pipeline/dist/apps/node-example/main.js:12
  throw new Error('Dynamic require of "' + x + '" is not supported');

Expected Behavior

My node-example app builded with success

GitHub Repo

https://github.com/whalemare/ts-pipeline

Steps to Reproduce

  1. Clone repo and install dependencies
git clone https://github.com/whalemare/ts-pipeline
cd ts-pipeline
git checkout feature/esbuild
yarn install
  1. Build and run example
nx run node-example:build
node dist/apps/node-example/main.js

Nx Report

λ  ts-pipeline feature/esbuild ✓ yarn nx report
yarn run v1.22.17
$ /Users/whalemare/ts-pipeline/node_modules/.bin/nx report
>  NX  Falling back to ts-node for local typescript execution. This may be a little slower.
  - To fix this, ensure @swc-node/register and @swc/core have been installed

 >  NX   Report complete - copy this into the issue template

   Node : 18.15.0
   OS   : darwin arm64
   yarn : 1.22.17
   
   nx                      : 15.9.2
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/cypress           : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/esbuild           : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/node              : 15.9.2
   @nrwl/react             : 15.9.2
   @nrwl/tao               : 15.9.2
   @nrwl/vite              : 15.9.2
   @nrwl/web               : 15.9.2
   @nrwl/webpack           : 15.9.2
   typescript              : 4.9.4

Failure Logs

file:///Users/whalemare/ts-pipeline/dist/apps/node-example/main.js:12
  throw new Error('Dynamic require of "' + x + '" is not supported');

Additional Information

No response

@AgentEnder AgentEnder added the scope: node Issues related to Node, Express, NestJS support for Nx label Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Jun 4, 2023

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 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants