spohl
spohl
NNuxt
Created by spohl on 4/12/2024 in #❓・help
@nuxt/eslint on a monorepo
Hello, i am havina nuxt3 project in a monorepo and i would like to make use of @nuxt/eslint. But i would need to limit the rules to "apps/render". I tried stuff like
import nuxtEslintConfig from './apps/render/eslint.config.mjs';

const nuxtEsLint = await nuxtEslintConfig;

export default [
// other rules
{
files: ['apps/render/**/*'],
...nuxtEsLint,
},
// mre rules
]
import nuxtEslintConfig from './apps/render/eslint.config.mjs';

const nuxtEsLint = await nuxtEslintConfig;

export default [
// other rules
{
files: ['apps/render/**/*'],
...nuxtEsLint,
},
// mre rules
]
But that doesn't work out: Oops! Something went wrong! 😦 ESLint: 9.0.0 ConfigError: Config (unnamed): Unexpected key "0" found. Any ideas how to solve this?
1 replies
NNuxt
Created by spohl on 4/26/2023 in #❓・help
Component loaded twice on layout change
If you want to change the layout programmatic the component is re-loaded. It would be nice pro prevent this as deferred components and requests are also restarted. It can be reproduced with this code:
<template>
<div>Test</div>
</template>
<script lang="ts" setup>
definePageMeta({
layout: false,
});
onBeforeMount(() => {
const route = useRoute();
route.meta.layout = false ? 'blank' : 'default';
});

console.log('Loaded');
</script>
<template>
<div>Test</div>
</template>
<script lang="ts" setup>
definePageMeta({
layout: false,
});
onBeforeMount(() => {
const route = useRoute();
route.meta.layout = false ? 'blank' : 'default';
});

console.log('Loaded');
</script>
You will find the console log twice. Maybe there is a better way to handle the layout change without being mounted? Here is a reproduction: https://stackblitz.com/edit/github-xhfdq1-de15an?file=src%2Fpages%2F[...all].vue,src%2Flayouts%2Fblank.vue,src%2Flayouts%2Fdefault.vue
1 replies
NNuxt
Created by spohl on 4/24/2023 in #❓・help
i18n not working with static site generation
Hi, i try to create static sites (ssr:false). When i launch the site i hit: "GET file:///i18n-config-3b43adf8.js net::ERR_FILE_NOT_FOUND" This file is not generated at all, but a familar one: "i18n.config.64f65730.js". Originated from: "i18n.options.2fc0184e.js" , find the code below.
import { b$ as __vitePreload, c0 as sharedExports } from "./entry.f6cb9516.js";
async function i18n_options(context) {
const loader = await __vitePreload(() => import("./i18n.config.64f65730.js"), true ? ["./i18n.config.64f65730.js","./entry.f6cb9516.js","./entry.9e1e5f52.css"] : void 0, import.meta.url).then((m) => m.default || m);
const config = sharedExports.isFunction(loader) ? await loader(context) : sharedExports.isObject(loader) ? loader : {};
{
let messages = null;
try {
const key = `/i18n-config-3b43adf8.js`;
messages = await __vitePreload(() => import( //// <-------------------- Here it happens
/* @vite-ignore */
key
/* webpackChunkName: nuxt-i18n-config-3b43adf8 */
), true ? [] : void 0, import.meta.url).then(
(m) => m.default || m
);
} catch (e) {
console.error(format(e.message));
}
config.messages = messages || {};
return config;
}
}
export {
i18n_options as default
};
import { b$ as __vitePreload, c0 as sharedExports } from "./entry.f6cb9516.js";
async function i18n_options(context) {
const loader = await __vitePreload(() => import("./i18n.config.64f65730.js"), true ? ["./i18n.config.64f65730.js","./entry.f6cb9516.js","./entry.9e1e5f52.css"] : void 0, import.meta.url).then((m) => m.default || m);
const config = sharedExports.isFunction(loader) ? await loader(context) : sharedExports.isObject(loader) ? loader : {};
{
let messages = null;
try {
const key = `/i18n-config-3b43adf8.js`;
messages = await __vitePreload(() => import( //// <-------------------- Here it happens
/* @vite-ignore */
key
/* webpackChunkName: nuxt-i18n-config-3b43adf8 */
), true ? [] : void 0, import.meta.url).then(
(m) => m.default || m
);
} catch (e) {
console.error(format(e.message));
}
config.messages = messages || {};
return config;
}
}
export {
i18n_options as default
};
Running in dev mode everything running smooth.. In this static mode, there is not vite at all involved (file://). Not sure how to tackle this one, any idea much appreciated.
2 replies
NNuxt
Created by spohl on 12/7/2022 in #❓・help
Can't resolve i18n on 'useNuxtApp()'
No description
3 replies