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

Nuxt 4 layers stater #967

Open
mrleblanc101 opened this issue Nov 21, 2024 · 0 comments
Open

Nuxt 4 layers stater #967

mrleblanc101 opened this issue Nov 21, 2024 · 0 comments

Comments

@mrleblanc101
Copy link

mrleblanc101 commented Nov 21, 2024

Hi,
I've created 2 seperate projects:

  1. npx nuxi init --template layer nuxt-test-layer
  2. npx nuxi init --template v4-compat nuxt-test-app

From the app, I required the layer hosted in our private gitlab instance and by providing GIGET_GITLAB_URL and GIGET_AUTH inside the .env file.

extends: [
    ['gitlab:sleblanc/nuxt-test-layer', { install: true }]
]

Once I started the project using pnpm dev, I instantly got this error:

ERROR [unhandledRejection] EMFILE: too many open files, watch
at FSWatcher._handle.onchange (node:internal/fs/watchers:207:21)

Image

After some debuging, I realised I needed to add future: { compatibilityVersion: 4 } to the layer too.
This made me thing, maybe there should be a template for a v4 compatible layer ?
Something like npx nuxi init --template v4-compat-layer test-layer

Also, it might be a good idea to warn the user if he try to use a v3 layer in v4, since it seem to cause incompatibility.
I didn't think it would since only the directory structure is slightly different.
I had to create app/ and move app.vue and components/HelloWorld.vue.
I don't know why without these changes, it would crash, but it seems like Vite was watching the whole node_modules to me.
I will open a new issue in @nuxt/nuxt if this is confirmed as a bug.

Image

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

No branches or pull requests

1 participant