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-unstyled-tailwind | ERROR Pre-transform error: Octal literal in strict mode #8

Open
mcnickbronx opened this issue Jan 23, 2024 · 4 comments

Comments

@mcnickbronx
Copy link

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
Copy link

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
Copy link
Author

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
Copy link

Alejandro-SB commented Feb 13, 2024

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
Copy link

dappiu commented Feb 17, 2024

@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.

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

3 participants