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

LaraMite's avatar

Jetstream Inertia Asset() Equivalent

I was trying to import an scss file from my resources/css folder to a file in the resources/js/components directory but can not seem to get the path right.

I assumed that this was relatively simple but was unable to find an answer to it.

I have tried:

@import '../css/example_folder/file.scss';

And

@import asset('css/example_folder/file.scss');
0 likes
6 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

The relative path should work. But try using a js import not a css import.

import '../css/example_folder/file.scss';
 
LaraMite's avatar

@Sinnbeck Is it meant to be wrapped in {}s ? I tried this and got

{ expected scss(css-lcurlyexpected)

I thought maybe I forgot a "{" somewhere in my vue file but did not find anything to be out of place. To be safe, I deleted everything in the script tag and tried it again. That did not work. I did the same thing with the scss file but that did not seem to resolve it.

LaraMite's avatar

@Sinnbeck Sure that should be easy I stripped the whole file down and still got the same errors

<template>
		<div>
		</div>
</template>
<script>
</script>
<style lang="scss">
@import '~@/fullcalendar/core/main.css';
@import '~@/fullcalendar/daygrid/main.css';
import '~@/fullcalendar/timegrid/main.css';
import '../css/example_folder/fullcalendar.scss';
</style>

When I use the "@import" it displays the error in the browser but not vs code but when I use "import" it displays an error in both the browser and vs code.

I have a feeling that this has something to do with a vite config

CamKem's avatar

Did you try importing it into your app.js file and implementing it from there?

LaraMite's avatar

I solved it with

Import '@fullcalendar/core/vdom';

Please or to participate in this conversation.