-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
inlineStyles don't work! script lang="ts" #26514
Comments
Hi @pmaiko , I've tried running it exactly as you described, both with and without As for your next steps, I strongly recommend taking advantage of auto imports by organizing your components inside a As for the code, it's identical to yours as well, except I moved my.vue into If you need any further assistance or have any other questions, feel free to ask! |
@MustafaM257 I don't understand how this could work for you! I opened examples for the purity of the experiment create file my.vue in components my.vue on your recommendation, I use auto-imported and i see this bug On my local machine, I see this bug too. Please help me. |
@pmaiko could you please upload a repo of the exact code, that's weird! it's not what showing on my end. |
@MustafaM257 https://github.com/pmaiko/nuxt3-test https://stackblitz.com/~/github.com/pmaiko/nuxt3-test commands node v20.10.0 |
this is how you add the style to the global one. Try to write <style scoped> |
@JCtapuk I know that. if I add scoped or module then it will work correctly. but I just want <style> |
I'm experiencing the exact same issue. |
Hey there! I'm experiencing the same (similar) issue. I'll try to help reproduce it with more details. NOTE Clone the repository: git clone https://github.com/vaheqelyan/nuxt-reproduce-26514 You have
<template>
<div>
<NavBar />
<main>
<slot />
</main>
<footer>Footer</footer>
</div>
</template>
<script setup lang="ts">
import NavBar from "~/components/NavBar/NavBar.vue";
</script>
<!-- When you comment out the style tag, the issue disappears. -->
<style>
html,
body {
min-height: 100%;
}
</style>
<template>
<nav>
<img
class="logo"
src="https://preview.redd.it/i-got-bored-so-i-decided-to-draw-a-random-image-on-the-v0-4ig97vv85vjb1.png?width=640&crop=smart&auto=webp&s=22ed6cc79cba3013b84967f32726d087e539b699"
/>
</nav>
</template>
<!-- Removing lang='ts' makes the issue disappear. -->
<script setup lang="ts">
onMounted(() => {
console.log("mounted");
});
</script>
<style>
.logo {
max-width: 100px;
}
</style> |
Hello Everyone, I am also facing the same issue with Nuxt using TypeScript in Build. The error disappears in v3.9.3 but occurs in a higher version of Nuxt. Do you know of any workaround or solution? |
Environment
❯ npx nuxi info
[15:27:51] Working directory: /home/projects/aonikwpkw.github
[15:27:51] Nuxt project info:
[15:27:51] 👉 Report an issue: https://github.com/nuxt/nuxt/issues/new
👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new
👉 Read documentation: https://nuxt.com
Reproduction
Create file app.vue
Create file pages/home.vue
Create file my.vue
yarn build
yarn start
Describe the bug
with lang="ts" - no style tag
without lang="ts" - has style tag
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: