primefaces / primevue-examples

PrimeVue Example Projects
MIT License
135 stars 45 forks source link

nuxt-unstyled-tailwind | ERROR Pre-transform error: Octal literal in strict mode #8

Open mcnickbronx opened 9 months ago

mcnickbronx commented 9 months ago

The downloaded project from the nuxt-unstyled-tailwind folder does not run.

When running the npm run dev script I get an error in the console.

ERROR Pre-transform error: Octal literal in strict mode (14:29)

Nuxt 3.9.3 with Nitro 2.8.1 23:10:29 23:10:30 ➜ Local: http://localhost:3000/ ➜ Network: use --host to expose

ℹ Using default Tailwind CSS file nuxt:tailwindcss 23:10:34 ➜ DevTools: press Shift + Alt + D in the browser (v1.0.8) 23:10:37

ℹ Tailwind Viewer: http://localhost:3000/_tailwind/ nuxt:tailwindcss 23:10:37 ℹ Compiled plugins/server.mjs in 787.03ms 23:10:38 ℹ Compiled plugins/client.mjs in 812.99ms 23:10:38 ℹ Compiled types/plugins.d.ts in 812.02ms 23:10:38

ERROR Pre-transform error: Octal literal in strict mode (14:29) 23:10:40

ℹ Vite client warmed up in 6968ms 23:10:47 ℹ Vite server warmed up in 6869ms 23:10:48 ✔ Nitro built in 2245 ms nitro 23:10:50


There is an error in the browser

500 [vite-node] [plugin:unctx:transform] [VITE_ERROR] virtual:nuxt:C:/Projects/1-zip/front-zip-shop/front-zip-shop/.nuxt/primevue-plugin.mjs:14:29

12 | import FocusTrap from 'primevue/focustrap'; 13 | import AnimateOnScroll from 'primevue/animateonscroll'; 14 | import Lara from 'C:\Projects\1-zip\front-zip-shop\front-zip-shop\presets\lara'; | ^ 15 |
16 |

at virtual:nuxt:C:/Projects/1-zip/front-zip-shop/front-zip-shop/.nuxt/primevue-plugin.mjs:14:29

Alejandro-SB commented 8 months ago

Similar issue here. I found something interesting. In windows, I get this:

eposprimevue-examplesolve import "C:UsersUsuariosource
uxt-unstyled-tailwindpresetslara" from "virtual:nuxt:C:\Users\Usuario\source\repos\primevue-examples\nuxt-unstyled-tailwind\.nuxt\primevue-plugin.mjs". Does the file exist?

But using an Ubuntu in WSL, it seems to work. Windows Node version: 18.18.2 Ubuntu Node version: 21.6.1

mcnickbronx commented 8 months ago

I had a problem in the path to the presets folder in Winodws in the nuxt.config.ts file

You need to put a dot in front of the /presets folder

importPT: { as: 'Lara', from: path.resolve(__dirname, './presets/lara/') },

Alejandro-SB commented 8 months ago

I had a problem in the path to the presets folder in Winodws in the nuxt.config.ts file

You need to put a dot in front of the /presets folder

importPT: { as: 'Lara', from: path.resolve(__dirname, './presets/lara/') },

Also did that. Didn't work either. The full project cloned does not work on windows for me.

EDIT: Can confirm. I created a test project and it works on Linux (EndeavourOS) but not on Windows

dappiu commented 8 months ago

@Alejandro-SB just get rid of path resolve and use relative path prefixed with ~ shortcut

importPT: { as: 'Lara', from: '~/presets/lara/' }

It will work both on Windows and Linux.