question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--bundler=vite option apparently ignored.

See original GitHub issue

Current Behavior

After running the commands below, following the nx documentation about vite

npm install --save-dev @nrwl/vite @nrwl/web
npm exec nx generate @nrwl/web:app my-app --bundler=vite

I end up with an app (with no package.json) and e2e tests all of which rely on Webpack and have no reference to vite at all. Vite has not been installed in the top level node_modules, there is no vite.config.js anywhere and the bundler argument seems to have been completely ignored.

Expected Behavior

A vite-based project is created

Github Repo

No response

Steps to Reproduce

Create an nx monorepo, run the above command.

Nx Report

[github/watchable]$ npm exec nx report

 >  NX   Report complete - copy this into the issue template

   Node : 18.12.1
   OS   : linux x64
   npm  : 9.1.1
   
   nx : 15.1.0
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.2.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.1.0
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.1.0
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.2.1
   @nrwl/js : 15.1.0
   @nrwl/linter : 15.1.0
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.2.1
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : 15.2.1
   @nrwl/webpack : 15.2.1
   @nrwl/workspace : 15.1.0
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @nrwl/vite: 15.2.1
         lerna: 6.0.3

Failure Logs

$ npm exec nx run my-app:serve

nx run my-app:serve

[webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:4200/, http://[::1]:4200/ [webpack-dev-server] 404s will fallback to ‘/index.html’

NX Web Development Server is listening at http://localhost:4200/

Entrypoint main 166 KiB = runtime.76e97c7a53fb704f.js 1.25 KiB main.7f0345943888a830.js 164 KiB Entrypoint polyfills 213 KiB = runtime.76e97c7a53fb704f.js 1.25 KiB polyfills.e4c7a9473addda75.js 212 KiB Entrypoint styles 121 KiB = runtime.76e97c7a53fb704f.js 1.25 KiB styles.ef46db3751d8e999.css 0 bytes styles.7eec08eab83498d4.js 119 KiB chunk (runtime: runtime) main.7f0345943888a830.js (main) 206 KiB [initial] [rendered] chunk (runtime: runtime) polyfills.e4c7a9473addda75.js (polyfills) 458 KiB [initial] [rendered] chunk (runtime: runtime) styles.ef46db3751d8e999.css, styles.7eec08eab83498d4.js (styles) 157 KiB (javascript) 80 bytes (css/mini-extract) [initial] [rendered] chunk (runtime: runtime) runtime.76e97c7a53fb704f.js (runtime) 3.37 KiB [entry] [rendered] webpack compiled successfully (aa2531bbb91ab686)

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cefncommented, Nov 28, 2022

Thanks for the followup. I’m happy to share in detail or engage in hallway testing if there’s an appetite to iterate on the DX. I’d love to have tooling to satisfy this scaffolding role (which embeds best practice and caching optimisations) but sometimes I speculate the complexity and black-box nature makes it unmanageable for maintainer OR user. I already shared some commentary on Slack at https://nrwlcommunity.slack.com/archives/CRXERGDA9/p1669293739088169?thread_ts=1669293739.088169&cid=CRXERGDA9

0reactions
mandarinicommented, Nov 28, 2022

Thank you @cefn . I am looking at the slack message, as well, now. I asked one of my team-mates to help, since maybe their take will be more accurate!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES Modules are terrible, actually - gists · GitHub
apparently not realizing that ESM doesn't actually change any of the JS ... It also means that you now need to make a...
Read more >
equire is not defined in es module scope, you can use import ...
Apparently ES Module cause this error. ... Adding it to import.meta seems natural - there's an option called initializeImportMeta which we can use....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found