atinux / content-wind

A lightweight Nuxt theme to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
https://content-wind.nuxt.space
MIT License
810 stars 56 forks source link

You need plugins to import files that are not JavaScript - from extends @nuxt-themes/elements components #65

Closed derogate closed 1 year ago

derogate commented 1 year ago

I am trying to deploy to Github Actions by using components extended from @nuxt-themes/elements which are Alert.vue, List.vue & CodeGroup.vue but got the following error in Github Actions:

Error:  Unexpected token (Note that you need plugins to import files that are not JavaScript)
file: /home/runner/work/blog/blog/blog/node_modules/.pnpm/@nuxt-themes+elements@0.9.4/node_modules/@nuxt-themes/elements/components/globals/Alert.vue?vue&type=style&index=0&scoped=5ebafdf9&lang.ts?inline&used:1:0
1: .alert{margin-top:var(--space-8);margin-bottom:var(--space-8);border-radius:var(--radii-md);padding-left:var(--space-...
   ^
Error:  Unexpected token (Note that you need plugins to import files that are not JavaScript)
  at error (node_modules/.pnpm/rollup@3.21.7/node_modules/rollup/dist/es/shared/node-entry.js:2125:30)
  at Module.error (node_modules/.pnpm/rollup@3.21.7/node_modules/rollup/dist/es/shared/node-entry.js:13452:16)
  at Module.tryParse (node_modules/.pnpm/rollup@3.21.7/node_modules/rollup/dist/es/shared/node-entry.js:14163:25)
  at Module.setSource (node_modules/.pnpm/rollup@3.21.7/node_modules/rollup/dist/es/shared/node-entry.js:13765:39)
  at ModuleLoader.addModuleSource (node_modules/.pnpm/rollup@3.21.7/node_modules/rollup/dist/es/shared/node-entry.js:23730:20)

Running it locally renders the Vue components fine & also builds the static production build without any problem.

Error happens while npm run generate in this context of Github Actions:

atinux commented 1 year ago

Could you try to add this in your nuxt.config:

export default defineNuxtConfig({
  experimental: {
    inlineSSRStyles: false
  }
})
derogate commented 1 year ago

Thank you, that works. I am trying to avoid using experimental configuration but at least, that will do for now.

atinux commented 1 year ago

Could you try to use Nuxt 3.5 and remove the experimental flag @derogate ?

derogate commented 1 year ago

Could you try to use Nuxt 3.5 and remove the experimental flag @derogate ?

Thanks for informing, just upgraded to Nuxt 3.5 & removed the experimental flag. Can build in Github Actions without error 👍