Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

viappio's avatar

vite cannot @import.. but it does

I'm installing the pikaday datepicker following this tutorial --> https://dev.to/snehalkadwe/how-to-use-pikaday-datepicker-library-in-laravel-8-and-livewire-4ka9 . The installation goes right and the css is loaded but in the vite console this error is present :

Unable to resolve `@import "./node_modules/pikaday/css/pikaday.css"` from <local_path>

my app.css is something like

@import './node_modules/pikaday/css/pikaday.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

[x-cloak] {
    display: none;
}

/* margine content centrale pagine */
.px-left-side-wide {
    padding-left: 4rem;
    padding-right: 2rem;
}
...
...
...

And again, the css is loaded correctly but the error is still there in the console. I don't know what to do.

0 likes
2 replies
vincent15000's avatar
Level 63

Are you sure that the path is right ?

@import './node_modules/pikaday/css/pikaday.css';

Where have you stored the app.css file ? In the same root folder that the node_modules folder ?

1 like
viappio's avatar

@vincent15000 you're right, the path was wrong, cause of course the default node module position from resources/css/ is:

@import '../../node_modules/pikaday/css/pikaday.css';

what threw me off this simple thing, it is how the hell the css is loaded anyway. I cleared the cache and deleted the node_modules dir and the css is still computed by the browser. Also intelliJ autompletes the path the wrong way. Kinda strange.

1 like

Please or to participate in this conversation.