oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
70.86k stars 2.46k forks source link

Support Nuxt (Vite framework for Vue) #3771

Open birkskyum opened 9 months ago

birkskyum commented 9 months ago

Nuxt.js GitHub - Website

What version of Bun is running?

0.7.0

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

What is the expected behavior?

➜ bun --bun run dev
Nuxi 3.6.5                                                                                                                                                 10:06:22 PM
Nuxt 3.6.5 with Nitro 2.5.2                                                                                                                                10:06:22 PM
[get-port] Unable to find an available port (tried 3000). Using alternative port: 3001                                                                     10:06:23 PM
                                                                                                                                                           10:06:23 PM
  > Local:    http://localhost:3001/ 
  > Network:  http://192.168.0.115:3001/
  > Network:  http://[2a02:a317:e440:2c80:1463:d84f:69c5:ac27]:3001/
  > Network:  http://[2a02:a317:e440:2c80:6c04:d94d:e2fb:8671]:3001/

✔ Nuxt Devtools is enabled v0.7.1 (experimental)                                                                                                          10:06:23 PM
ℹ Vite client warmed up in 591ms                                                                                                                          10:06:24 PM
✔ Nitro built in 249 ms     

What do you see instead?

➜ bun --bun run dev
$ nuxt dev
223 |     throw err;
224 |   return ret.stdout;
225 | }
226 | function fork() {
227 | 
228 |   throw new Error("Not implemented");
           ^
error: Not implemented
      at fork (node:child_process:228:8)
      at start (/Users/admin/repos/my-nuxt/node_modules/nuxi/dist/cli-wrapper.mjs:27:16)
      at startSubprocess (/Users/admin/repos/my-nuxt/node_modules/nuxi/dist/cli-wrapper.mjs:23:2)
      at /Users/admin/repos/my-nuxt/node_modules/nuxi/dist/cli-wrapper.mjs:7:2
error: script "dev" exited with code 1 (SIGHUP)

Additional information

Related:

birkskyum commented 9 months ago

Breaking because child_process.fork() isn't implemented yet

danielwaltz commented 9 months ago

Tested the latest release (v0.7.1) in a couple of my Nuxt projects by running bun --bun run dev and I can confirm that Nuxt is working now (at least for me). So cool! 🎉

Also tested bun --bun run build, bun --bun run generate, and bun --bun run preview without issues.

birkskyum commented 9 months ago

Awesome, thank you for sharing your findings! Closed by #3851

birkskyum commented 9 months ago

At least in some environments, the Nitro issue with formatWithOptions still appear to be breaking the repro detailed above:

➜ bun --bun run dev
$ nuxt dev
SyntaxError: Import named 'formatWithOptions' not found in module 'node:util'.
birkskyum commented 9 months ago

@danielwaltz , I'm a bit puzzled why this worked for you. Which architecture/os did you use?

danielwaltz commented 9 months ago

@birkskyum I am on an apple silicon mac (arm64). I'm using the latest non-preview version of macOS (13.4.1 Ventura). For bun, I was using 0.7.1 at time of posting, but I also just now tried with the latest version (0.7.2) and it is still working for me.

What I suspect could be the case is the project you are referencing is using Nuxt features (like server endpoints or something else) that my smaller projects are not. Because Nuxt is dynamic about its dependencies and what is loaded at runtime based on what is used, my simple projects (both are personal/portfolio sites and one doesn't even use a router) probably have a smaller surface area of required features.

I wish I had a larger Nuxt project to test with! If you want to verify that Nuxt can run, feel free to clone my personal site and run bun i and bun --bun run dev. It should work!

EDIT: Also, I think it is worth noting that while Nuxt 3 is by default using Vite behind the scenes, it does still support webpack usage. I would also verify that the project you're using is not configured to use webpack instead just in case!

birkskyum commented 9 months ago

I just followed the reproduction steps, but i think you're right the use of a server makes the difference, because the error i get is related to Nitro

PushUpek commented 9 months ago

I have quite large NuxtJS project.

bun version: 0.7.3 architecture: MacOS M1

bun --bun run dev or bun --bun run generate throws this error:

[0.02ms] ".env"
24 |       if (arg && typeof arg.stack === "string") {
25 |         return arg.message + "\n" + this.formatStack(arg.stack, opts);
26 |       }
27 |       return arg;
28 |     });
29 |     return node_util.formatWithOptions(opts, ..._args);
               ^
TypeError: node_util.formatWithOptions is not a function. (In 'node_util.formatWithOptions(opts, ..._args)', 'node_util.formatWithOptions' is undefined)
      at formatArgs (/Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/consola/dist/shared/consola.deac7d5a.cjs:29:11)
      at formatLogObj (/Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/consola/dist/shared/consola.4bbae468.cjs:569:37)
      at log (/Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/consola/dist/shared/consola.deac7d5a.cjs:53:17)
      at _log (/Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/consola/dist/core.cjs:383:6)
      at resolveLog (/Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/consola/dist/core.cjs:351:8)
      at _logFn (/Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/consola/dist/core.cjs:379:4)
      at /Users/pushupek/Praca/FrameLogic/src/gps-web/node_modules/nuxt/bin/nuxt.js:8:4
error: script "dev" exited with code 1 (SIGHUP)
birkskyum commented 9 months ago

@PushUpek , it's caused by this

paperdave commented 9 months ago

Getting somewhere...

image

Blockers

paperdave commented 8 months ago

Getting somewhere...

image

Blockers

birkskyum commented 8 months ago

it does seem like the server can stay open now, but build gives:

➜ bun --bun run build
$ nuxt build
[10:08:34 AM] Nuxi 3.6.5

[10:08:34 AM]  WARN  Changing NODE_ENV from development to production, to avoid unintended behavior.

[10:08:34 AM] Nuxt 3.6.5 with Nitro 2.5.2
[10:08:35 AM] ℹ Building client...
[10:08:35 AM] ℹ vite v4.3.9 building for development...
[10:08:36 AM] ℹ ✓ 97 modules transformed.
[10:08:36 AM] ℹ .nuxt/dist/client/manifest.json                   1.59 kB │ gzip:  0.32 kB
[10:08:36 AM] ℹ .nuxt/dist/client/_nuxt/error-dev.00ee2d03.css    2.26 kB │ gzip:  0.81 kB
[10:08:36 AM] ℹ .nuxt/dist/client/_nuxt/error-404.1da70a4c.css    3.66 kB │ gzip:  1.14 kB
[10:08:36 AM] ℹ .nuxt/dist/client/_nuxt/entry.9ed27021.css       12.44 kB │ gzip:  2.48 kB
[10:08:36 AM] ℹ .nuxt/dist/client/_nuxt/error-dev.4413317b.js     2.41 kB │ gzip:  1.24 kB │ map:   4.53 kB
[10:08:36 AM] ℹ .nuxt/dist/client/_nuxt/error-404.e8b9af35.js     6.90 kB │ gzip:  3.12 kB │ map:  24.41 kB
[10:08:36 AM] ℹ .nuxt/dist/client/_nuxt/entry.1866d780.js       225.83 kB │ gzip: 66.69 kB │ map: 857.85 kB
[10:08:36 AM] ℹ ✓ built in 1.39s
[10:08:36 AM] ✔ Client built in 1392ms
[10:08:36 AM] ℹ Building server...
[10:08:36 AM] ℹ vite v4.3.9 building SSR bundle for development...
[10:08:37 AM] ℹ ✓ 42 modules transformed.
[10:08:37 AM] ℹ .nuxt/dist/server/styles.mjs                           0.07 kB
[10:08:37 AM] ℹ .nuxt/dist/server/_nuxt/island-renderer-f70c2cce.js    1.05 kB │ map:   1.41 kB
[10:08:37 AM] ℹ .nuxt/dist/server/_nuxt/error-dev-c6a413fd.js          3.52 kB │ map:   4.60 kB
[10:08:37 AM] ℹ .nuxt/dist/server/_nuxt/error-404-2bdc838f.js         10.23 kB │ map:  19.12 kB
[10:08:37 AM] ℹ .nuxt/dist/server/server.mjs                         122.99 kB │ map: 165.13 kB
[10:08:37 AM] ℹ ✓ built in 359ms
[10:08:37 AM] ✔ Server built in 366ms

[10:08:37 AM]  ERROR  { columns: 47, date: true, colors: false, compact: true } { [SystemError] syscall: 'TODO', errno: -126 }
paperdave commented 8 months ago

progress on build:

havent taken a look fully at why the process dies on first request

toto6038 commented 8 months ago

I would like to report that using Nuxt with Nuxt Content module enabled will cause Nuxt failed to start. I was using bun install and bun --bun run dev in a repository using pnpm. I found it was @nuxt/content the cause of error by disabling all modules in nuxt.config.ts and then adding them back one after another.

Error message

Nuxi 3.6.5                                                                                                                                       11:23:20 AM
Nuxt 3.6.5 with Nitro 2.6.0                                                                                                                      11:23:20 AM
                                                                                                                                                 11:23:21 AM
  > Listening:    http://localhost:3000/ 

ℹ Using default Tailwind CSS file                                                                                              nuxt:tailwindcss 11:23:21 AM

 ERROR  Cannot start nuxt:  {}                                                                                                                   11:23:21 AM

Environment

sw_vers output:

ProductName:        macOS
ProductVersion:     13.4.1
ProductVersionExtra:    (c)
BuildVersion:       22F770820d

bun nuxi info output:

- Operating System: `Darwin`
- Node Version:     `v18.16.1`
- Nuxt Version:     `3.6.5`
- Nitro Version:    `2.5.2`
- Package Manager:  `pnpm@8.6.12`
- Builder:          `vite`
- User Config:      `css`, `devtools`, `modules`, `imports`, `pinia`, `postcss`, `gtm`, `security`, `runtimeConfig`
- Runtime Modules:  `@nuxtjs/tailwindcss@6.8.0`, `@pinia/nuxt@0.4.11`, `@nuxt/image@1.0.0-rc.1`, `@vueuse/nuxt@10.3.0`, `nuxt-lodash@2.5.0`, `nuxt-security@0.14.4`, `@zadigetvoltaire/nuxt-gtm@0.0.13`, `@nuxt/content@2.7.2`
- Build Modules:    `-`
birkskyum commented 8 months ago

@toto6038 , can you make a small reproduction of this?

birkskyum commented 8 months ago

build and generate works now with latest canary.

There is a single issue left, that impact both preview and bun --bun x nuxi@latest init my-nuxt-app, which is:

error: script "preview" exited with code 1 (SIGHUP)

toto6038 commented 8 months ago

@birkskyum Sorry for late reply since I was on vacation. Please refer to the minimal reproduction. To see the output from console, you may need to fork the Repl and run it with Run button.

giorgiopogliani commented 8 months ago

Testing my project on Nuxt 2 and it doesn't run. I get TypeError: undefined is not an object (evaluating 'e.columns') from the consola package version 2.15.3.

birkskyum commented 8 months ago

Repro for the issue mentioned by @giorgiopogliani - with consola 2.x, and thus Nuxt 2 as well:

bun add consola@2.15.3

const consola = require('consola')

consola.success('Built!')
consola.info('Reporter: Some info')
consola.error(new Error('Foo'))

Each of these three lines gives the error:


➜ bun index.ts
178 |             return t.writeSync(D.fd, u);
179 |           default:
180 |             return r.call(D, u);
181 |         }
182 | 
183 |       }(this.formatLogObj(u, { width: e.columns || 0 }) + "\n", u.level < 2 ? r : e, D ? "async" : "default");

TypeError: undefined is not an object (evaluating 'e.columns')
      at log (/Users/admin/repos/bun-kitchensink/node_modules/consola/dist/consola.js:1:43104)
      at _log (/Users/admin/repos/bun-kitchensink/node_modules/consola/dist/consola.js:1:35096)
birkskyum commented 8 months ago

@giorgiopogliani , nuxt 2 have "consola": "3.2.3" (package.json) - are you on the latest nuxt 2.x?

tuan3w commented 8 months ago

I had similar problem like @giorgiopogliani. It seems like pinning concola version to 3.2.3 fix this issue. However, on my product project, i saw this error while building server part. I'm not sure what causes this error:

...
 ERROR  Could not fetch loading indicator: three-bounce 
....
ERROR in ./components/common/bars/TestComponent.vue?vue&type=template&id=641fddae&
Module build failed (from ./node_modules/vuetify-loader/lib/loader.js):
TypeError: undefined is not an object (evaluating 'Object.keys(module.constructor._pathCache)')
    at keys (native)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/decache/decache.js:40:17)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/matcher/generator.js:45:1)
    at forEach (:1:11)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/matcher/generator.js:26:21)
    at global code (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/matcher/generator.js:43:8)
    at anonymous (native)
    at require (:1:11)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/matcher/tag.js:2:38)
    at global code (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/matcher/tag.js:9:8)
    at anonymous (native)
    at require (:1:11)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/loader.js:5:6)
    at global code (/home/tuan3w/workspace/project/node_modules/vuetify-loader/lib/loader.js:119:8)
    at anonymous (native)
    at require (:1:11)
    at loadLoader (/home/tuan3w/workspace/project/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js:18:4)
    at iteratePitchingLoaders (/home/tuan3w/workspace/project/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:169:5)
    at runLoaders (/home/tuan3w/workspace/project/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:365:5)
    at doBuild (/home/tuan3w/workspace/project/node_modules/webpack/lib/NormalModule.js:296:4)
    at buildModule (/home/tuan3w/workspace/project/node_modules/webpack/lib/Compilation.js:744:26)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/webpack/lib/Compilation.js:986:14)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/webpack/lib/NormalModuleFactory.js:409:5)
    at anonymous (:5:10)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/webpack/lib/NormalModuleFactory.js:138:9)
    at <anonymous> (/home/tuan3w/workspace/project/node_modules/webpack/lib/NormalModuleFactory.js:346:9)
    at processTicksAndRejections (:1:1302)
 @ ./components/common/bars/TestComponent.vue 1:0-88 11:2-8 12:2-17
 @ ./.nuxt/components/index.js
 @ ./.nuxt/components/plugin.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/client.js
giorgiopogliani commented 8 months ago

@birkskyum I am on Nuxt 2.15 because I have to stay on Vue 2.6

SubodhDahal commented 8 months ago

I am also not able to run a Nuxt 3 app using bun 1.0.0. I tested on macOS 13.5.2 (22G91) with Apple M1 Max chip.

I get a generic message about not being able to start nuxt when I run bun --bun run dev:

Nuxi 3.6.5                                                                                                                                       
Nuxt 3.6.5 with Nitro 2.6.3                                                                                                                      

  > Listening:    http://localhost:3000/ 

ℹ Using default Tailwind CSS file                                                                                              nuxt:tailwindcss

 ERROR  Cannot start nuxt:  {}                            

And I get the following error when I run bun --bun run build:

$ nuxt build
Nuxi 3.6.5                                                                                                                                      

 WARN  Changing NODE_ENV from development to production, to avoid unintended behavior.                                                           

Nuxt 3.6.5 with Nitro 2.6.3                                                                                                                     
ℹ Using default Tailwind CSS file                                                                                              nuxt:tailwindcss 

 ERROR  { columns: 157, date: true, colors: false, compact: true } {}                                                                           

error: script "build" exited with code 1 (SIGHUP)

It's for a fairly simple static website(repo) with very few devDependencies and no dependencies:

"devDependencies": {
    "@nuxt/content": "^2.7.2",
    "@nuxt/image-edge": "^1.0.0-rc.1-28180077.d51e794",
    "@nuxtjs/color-mode": "^3.3.0",
    "@nuxtjs/tailwindcss": "^6.8.0",
    "@tailwindcss/typography": "^0.5.8",
    "nuxt": "3.6.5"
  }
leochoo commented 7 months ago

Followed the official guide, but \gGot this error today. bun run dev works, but bun --bun run dev does not.

I'm using Apple Silicon.

CleanShot 2023-09-11 at 19 10 34

Giton22 commented 7 months ago

Followed the official guide, but \gGot this error today. bun run dev works, but bun --bun run dev does not.

I think that's because nuxt runs the dev server with Node by default and the issue is with bun runtime here.

Illuday commented 7 months ago

Got the Cannot start nuxt: undefined is not an object (evaluating 'e.columns') with bun --bun run dev.

In my case, it's caused by nuxt-purgecss module. Disable it make my environment work.

modules: [
    // 'nuxt-purgecss',
    ['@funken-studio/sitemap-nuxt-3', { generateOnBuild: true }],
    'nuxt-security',
    '@pinia/nuxt',
],
sbstnplcn commented 7 months ago

Hi, does Bun 1.0.0 working with Nuxt 2 ? I've tried today and have the TypeError: undefined is not an object (evaluating 'e.columns') error, any clue ? Thanks

birkskyum commented 7 months ago

@sbstnplcn, @Illuday , it's this consola issue that hasn't been resolved yet. If you are able to update to a newer next 2.x or nuxt 3.x that should do it.

sbstnplcn commented 7 months ago

@birkskyum thanks for your answer, I'm already running the last Nuxt v2.17.1 version and can't move to 3.x for now, I will wait until Nuxt release a new v2.x version with this resolved issue.

Illuday commented 7 months ago

@sbstnplcn, @Illuday , it's this consola issue that hasn't been resolved yet. If you are able to update to a newer next 2.x or nuxt 3.x that should do it.

Got the error on nuxt 3.7.1, the problem for me is nuxt-purgecss!

leochoo commented 7 months ago

Anyone solved / worked around this?

Followed the official guide, but \gGot this error today. bun run dev works, but bun --bun run dev does not.

I'm using Apple Silicon.

CleanShot 2023-09-11 at 19 10 34

ExEr7um commented 7 months ago

Anyone solved / worked around this?

Followed the official guide, but \gGot this error today. bun run dev works, but bun --bun run dev does not. I'm using Apple Silicon. CleanShot 2023-09-11 at 19 10 34

It could be because of %20 in path. Can you try to put your project in root of your user?

Hebilicious commented 7 months ago

Something that could be related that happens to me, when I run bun dev, ctrlc + C, bun dev, For some reasons the old dev server isn't correctly destroyed, and this opens a new one on the next port (3000, 3001, ...). Anyone else has this issue ?

muffe commented 7 months ago

I am also not able to run a Nuxt 3 app using bun 1.0.0. I tested on macOS 13.5.2 (22G91) with Apple M1 Max chip.

I get a generic message about not being able to start nuxt when I run bun --bun run dev:

Nuxi 3.6.5                                                                                                                                       
Nuxt 3.6.5 with Nitro 2.6.3                                                                                                                      

  > Listening:    http://localhost:3000/ 

ℹ Using default Tailwind CSS file                                                                                              nuxt:tailwindcss

 ERROR  Cannot start nuxt:  {}                            

I get the exact same error with the @nuxtjs/supabase module. As soon as I comment it out, the app starts fine.

Running Nuxt 3.7.1 on WSL 2 Ubuntu

tuan3w commented 7 months ago

I tried to investigate more into the problem with nuxt 2 & consola. The reason why it doesn't work with consola 2 is that consola 2 is using console._stdout which isn't available in bun. Some libraries use consola v2 causing this problem. Force using consola 3.2.3 fixes this problem:

{
  "resolutions": {
     "consola": "3.2.3"
  }
}

However, I still can't build my code because this error https://github.com/oven-sh/bun/issues/4591. I got these errors:

ERROR in ./node_modules/vue2-perfect-scrollbar/dist/vue2-perfect-scrollbar.css (./node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/postcss-loader/dist/cjs.js??ref--3-oneOf-1-2!./node_modules/vue2-perfect-scrollbar/dist/vue2-perfect-scrollbar.css)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: stacks.shift is not a function. (In 'stacks.shift()', 'stacks.shift' is undefined)

/home/tuan3w/workspace/XXX/node_modules/@nuxt/components/dist/loader.js??ref--0-0!/home/tuan3w/workspace/XXX/node_modules/vue-loader/lib/index.js??vue-loader-options!/home/tuan3w/workspace/XXX/components/analytics/chart/XXX.vue c9890deed0259bd97c156953285a51b6
An error occurred while decoding the string
birkskyum commented 7 months ago

that one is similar to

cosmith commented 7 months ago

I'm having an issue with consola 2.15 too, because of https://github.com/vbenjs/vite-plugin-html. Unfortunately we can't yet use overrides (https://github.com/oven-sh/bun/issues/1134)

rafaelfess commented 7 months ago

Without NodeJS installed, bun x seems to not respect the --bun flag.

❯ bun --version
1.0.1

❯ bunx --bun nuxi@latest init my-app
/usr/bin/env: ‘node’: No such file or directory
error: "nuxi" exited with code 127

❯ bunx nuxi@latest init my-app
/usr/bin/env: ‘node’: No such file or directory
error: "nuxi" exited with code 127

I can't even initialize a Nuxt 3 app with only bun installed on the system.

These are the instructions from bun's release blog post.

As I understand it, bun should only use NodeJS by default if --bun is not passed as a flag, as noted in the documentation.

birkskyum commented 7 months ago

@tuan3w , can you can try upgrading to latest canary and build again? The "stacks.shift" issue should be resolved now

tuan3w commented 7 months ago

Hi @birkskyum

Thanks for the update. After updating to the latest canary, I got this error while building:

Module build failed (from ./node_modules/vuetify-loader/lib/loader.js):
TypeError: undefined is not an object (evaluating 'Object.keys(module.constructor._pathCache)')
    at keys (native)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/node_modules/decache/decache.js:40:4)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/matcher/generator.js:45:1)
    at forEach (:1:21)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/matcher/generator.js:26:2)
    at global code (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/matcher/generator.js:43:8)
    at anonymous (native)
    at require (:1:21)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/matcher/tag.js:2:33)
    at global code (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/matcher/tag.js:9:8)
    at anonymous (native)
    at require (:1:21)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/loader.js:5:6)
    at global code (/home/tuan3w/workspace/VueProject/node_modules/vuetify-loader/lib/loader.js:119:8)
    at anonymous (native)
    at require (:1:21)
    at loadLoader (/home/tuan3w/workspace/VueProject/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js:18:4)
    at iteratePitchingLoaders (/home/tuan3w/workspace/VueProject/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/home/tuan3w/workspace/VueProject/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
    at doBuild (/home/tuan3w/workspace/VueProject/node_modules/webpack/lib/NormalModule.js:295:3)
    at buildModule (/home/tuan3w/workspace/VueProject/node_modules/webpack/lib/Compilation.js:744:26)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/webpack/lib/Compilation.js:986:10)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/webpack/lib/NormalModuleFactory.js:409:5)
    at anonymous (:5:1)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/webpack/lib/NormalModuleFactory.js:138:5)
    at <anonymous> (/home/tuan3w/workspace/VueProject/node_modules/webpack/lib/NormalModuleFactory.js:345:23)
    at processTicksAndRejections (:55:77)
 @ ./components/VerifyAccount.vue 1:0-92 10:2-8 11:2-17
 @ ./.nuxt/components/index.js
 @ ./.nuxt/components/plugin.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/client.js

ERROR in ./components/Component.vue?vue&type=template&id=e9cd33f6&

Extra information:

leochoo commented 7 months ago

@ExEr7um

It could be because of %20 in path. Can you try to put your project in root of your user? Thank you! Removing the space within the path to the project solved it! (I did not have to move it to root)

BUT... the app started by bun --bun run dev will hang.. -> Fixed it by upgrading to Bun v1.0.2! 😀

cosmith commented 7 months ago

Since https://github.com/oven-sh/bun/pull/5842 was merged I tested with bun upgrade --canary. No more errors when building and running my vite app!

birkskyum commented 7 months ago

build and generate works now with latest canary.

There is a single issue left, that impact both preview and bun --bun x nuxi@latest init my-nuxt-app, which is:

  • For creation of repo (bun --bun x nuxi@latest init my-nuxt-app, select install with bun)
 ERROR  Error: Command failed: bun install                                                                                               
The first argument must be a Readable, a ReadableStream, or an async iterable.
  • For bun --bun run preview
ERROR  Command failed: npx serve ./public                                                                                                 
The first argument must be a Readable, a ReadableStream, or an async iterable.

error: script "preview" exited with code 1 (SIGHUP)

Consola issues seem to be fixed now, but these errors still exist.

romastolbov commented 7 months ago

There is a problem with @nuxt/content

"@nuxt/content": "^2.8.2",
"nuxt": "^3.7.3"

In my nuxt.config.ts:

  modules: [
    '@nuxt/content',
  ],

bun --bun run dev return ERROR Cannot start nuxt: {}

Снимок экрана 2023-09-21 в 11 56 05
birkskyum commented 4 months ago

@romastolbov , do you see that on latest versions as well? I get this output with bun --bun run dev (bun 1.0.18)

➜ bun --bun run dev    
$ nuxt dev
Nuxt 3.8.2 with Nitro 2.8.1                                                            12:29:06 PM
                                                                                       12:29:07 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

  ➜ DevTools: press Shift + Option + D in the browser (v1.0.6)                         12:29:07 PM

ℹ Vite client warmed up in 179ms                                                      12:29:07 PM
ℹ Vite server warmed up in 638ms                                                      12:29:08 PM
✔ Nitro built in 251 ms  
romastolbov commented 4 months ago

@birkskyum its ok now

cotneit commented 1 month ago

build and generate works now with latest canary.

There is a single issue left, that impact both preview and bun --bun x nuxi@latest init my-nuxt-app, which is:

  • For creation of repo (bun --bun x nuxi@latest init my-nuxt-app, select install with bun)
 ERROR  Error: Command failed: bun install                                                                                               
The first argument must be a Readable, a ReadableStream, or an async iterable.
  • For bun --bun run preview
ERROR  Command failed: npx serve ./public                                                                                                 
The first argument must be a Readable, a ReadableStream, or an async iterable.

error: script "preview" exited with code 1 (SIGHUP)

This is #7068