-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(nuxt): Automatically detect environment #15179
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
Conversation
|
If the console logs are removed, should this be ready to be reviewed? :) |
|
Hi @mydea, as mentioned in the issue, I tried setting up an environment to test locally, but my console.log statements aren't showing up, and I’m not sure if this is normal or if I made a mistake when setting up the local module. I opened the MR to get feedback on whether it's expected not to see the console.log outputs and why the environment setup isn't working on my end. Also, I feel like there’s a lack of a contribution guide, which could help with improving the module. |
|
I attempted to import the module locally using: export default defineNuxtConfig({
modules: ['../sentry-javascript/packages/nuxt/src']
})However, my app gets stuck on |
|
Ah sorry, I did not connect this to the issue. Somebody from the team will look into it, we are quite swamped right now and parts of the team that have the most knowledge on Nuxt are currently unavailable, so it may take a few days, but we'll try to look into it next week latest! |
|
This looks good in general, please add this to the E2E test as well (here). Regarding testing this locally: You can build the package, then build the tarball and then add this tarball like a npm package in your test application's node_modules. Then you can set up Sentry in Nuxt as you would normally do this. |
|
Closing due to inactivity. |
Nuxt shows if it is running in a dev environment in the variable `import.meta.dev` ([docs](https://nuxt.com/docs/4.x/api/advanced/import-meta#runtime-app-properties)) - the Vite variable `import.meta.env.DEV` ([docs](https://vite.dev/guide/env-and-mode#built-in-constants)) is not available. To test this, a dev E2E test environment has been added. This includes a bash script which runs `nuxt dev` first to generate the necessary files and then starts the dev command again with the `NODE_OPTIONS` env. Right now, the development environment tests only test this specific feature (detecting the dev environment) because a bunch of existing tests are failing in dev mode. This is probably because the dev test setup needs to be a bit different (like waiting for `networkidle`) and a lot of tests would need some adaption (can be done in another PR). Added an entry to contributors as there was already a PR for that a while ago: #15179 Closes #15623 Closes #15147
Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint) & (yarn test).closes #15147