Coder Social home page Coder Social logo

Code Unable to Build - Nuxt Build Error: [vite:build-import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files about nuxt HOT 7 CLOSED

nosizejosh avatar nosizejosh commented on June 14, 2024
Code Unable to Build - Nuxt Build Error: [vite:build-import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files

from nuxt.

Comments (7)

nosizejosh avatar nosizejosh commented on June 14, 2024

@BobbieGoede please can you have a look at this for me?

from nuxt.

github-actions avatar github-actions commented on June 14, 2024

Would you be able to provide a reproduction? πŸ™

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

πŸ‘‰ https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
πŸ‘‰ https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. πŸ‘Œ

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

from nuxt.

nosizejosh avatar nosizejosh commented on June 14, 2024

I have tried to remove the "culprit" code and even culprit files but attempts just lead to new culprits with more errors.

[vite:build-import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.
file: D:/proj/components/details/Index.vue:205:64
203: onUnmounted(() => {
204:     removeCardServiceSubscription(cardServicesSubscription)
205:     :", removeCardServiceSubscription(cardServicesSubscription))
                                                                     ^
206: });

  at getRollupEror (/D:/proj/node_modules/rollup/dist/es/shared/parseAst.js:375:41)
  at error (/D:/proj/node_modules/rollup/dist/es/shared/parseAst.js:372:42)
  at Object.error (/D:/proj/node_modules/rollup/dist/es/shared/node-entry.js:19394:20)
  at Object.error (/D:/proj/node_modules/rollup/dist/es/shared/node-entry.js:18504:42)
  at Object.transform (/D:/proj/node_modules/vite/dist/node/chunks/dep-jDlpJiMN.js:66235:22)
  at async /D:/proj/node_modules/vite-plugin-inspect/dist/index.mjs:377:17

Leads me to believe it has to do with the nuxt and modules, note this code still runs fine just fails to build.

I need help to get unstuck. No easy way to create a reproduction, without adding lots of files involved.

from nuxt.

nosizejosh avatar nosizejosh commented on June 14, 2024

Solved it by creating another app and moving my code in bits and testing. Not sure what the source of this issue is.

from nuxt.

nosizejosh avatar nosizejosh commented on June 14, 2024

I have now been able to find the culprit.
Adding nuxtsecurity package back into the new code generated this error.
Issue reported here Baroshem/nuxt-security#390



from nuxt.

nosizejosh avatar nosizejosh commented on June 14, 2024

Issue confirmed.

For anyone else having same issue or similar, please follow this Baroshem/nuxt-security#390

from nuxt.

manniL avatar manniL commented on June 14, 2024

Let's track in Baroshem/nuxt-security#390 then πŸ‘

from nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.