-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bad template generation with i18n module #135
Comments
Hi! Yeah there is a problem I spotted with the "prefix" strategy i'm sorry for this. I'll have to refactor a significant part of stuff on 4.0 and it's already in progress |
looks promsing, is there any beta version yet? |
Not yet it's not usable, i'll tell you when it's ready. But i'll surely will change how i18n types will work |
I'm also running into the same error. Error is different but still traces to
|
What is the roadmap for this module when contrasted with Nuxt's |
I second that question. To me, that option seems to be the canonic approach, even if it's marked as experimental. |
How did you enable i18n tying with experimental.typedPages ?? |
I just enabled the option, and the linked documentation describes what effect it had:
For other i18n typing support, you have to look elsewhere. I personally found the i18n module's typing support to be lackluster in general, but specifically for links, this experimental option worked well. |
Describe the bug
Nuxt won't start when i18n is enabled. the following errors printed in console:
Expected behavior
to run nuxt normally
Screenshots
![__paths d ts-1](https://private-user-images.githubusercontent.com/36755337/296771523-16dc65ec-3fed-4ff3-938e-18b5cb0be03a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTI2NDAsIm5iZiI6MTcyMDM1MjM0MCwicGF0aCI6Ii8zNjc1NTMzNy8yOTY3NzE1MjMtMTZkYzY1ZWMtM2ZlZC00ZmYzLTkzOGUtMThiNWNiMGJlMDNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDExMzkwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEzNmJhZGI2ZTg0ODBkMGM4YjFjNTE4MmM5YzJhOGNlMWYxZDVmOWI5YWU4MGVlMzk2ODRiNWM1NzQ5YmVlZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.dHKoXmzUQ5bO7RMYL6zK1113n6ZE0tfWWAgkJph9y9s)
![__paths d ts-2](https://private-user-images.githubusercontent.com/36755337/296771529-6ff7fed8-1453-4269-85a4-1ef6931beab9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTI2NDAsIm5iZiI6MTcyMDM1MjM0MCwicGF0aCI6Ii8zNjc1NTMzNy8yOTY3NzE1MjktNmZmN2ZlZDgtMTQ1My00MjY5LTg1YTQtMWVmNjkzMWJlYWI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDExMzkwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllMmMxZWRkZTZkNzNmMGE0NjQxMDYxOTI5MThjNGQ4OGQ3YTEzOWEwNmMwN2U5MGY2OWZkMTM1NWUwMWYyNzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.jGU2VH1ErJkI77WmBFG2AtsBzmgrCSgKQ7xoEWyi5Uc)
![__routes d ts-1](https://private-user-images.githubusercontent.com/36755337/296771533-4f47fb4d-a183-4285-87a4-42d52f045f8a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTI2NDAsIm5iZiI6MTcyMDM1MjM0MCwicGF0aCI6Ii8zNjc1NTMzNy8yOTY3NzE1MzMtNGY0N2ZiNGQtYTE4My00Mjg1LTg3YTQtNDJkNTJmMDQ1ZjhhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDExMzkwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3ZmMxYzcwOGRmM2JkZTUyYjUyYTljMGZlODJjZDk0NzVmNmUwNDI2OGE0YmQxNzY4NTYyZTkwNTg5OGY3MzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.v7BoGZtZjt3c9DnxcobFinYkmT78Q2wUH40MQV_CT9c)
![__routes d ts-2](https://private-user-images.githubusercontent.com/36755337/296771535-16cf24e3-46f3-4846-ad05-be156aa15eae.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTI2NDAsIm5iZiI6MTcyMDM1MjM0MCwicGF0aCI6Ii8zNjc1NTMzNy8yOTY3NzE1MzUtMTZjZjI0ZTMtNDZmMy00ODQ2LWFkMDUtYmUxNTZhYTE1ZWFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDExMzkwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlN2MzNGU3MzFlZWNhNzg4NjM2ZGEzNzA1N2E5ODNkZjM1YTM0YjY2MTBlMjYxNzhjYTJhNzNjMmE3N2ZlM2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OBP4garpRq1mZaEXBs2yMBmZSFyu8X5FvfS13SEX8ts)
upon checking the generated .ts files, found those problems:
Environnement infos
Your
pages
folder structurepages
├── admin
│ └── index.vue
└── index.vue
Your nuxt.config.ts
modules: [
'@pinia/nuxt',
['@nuxtjs/eslint-module', eslintConfig],
['@nuxtjs/i18n', i18nConfig],
'@formkit/auto-animate',
'@vueuse/nuxt',
['@nuxt/image', imageConfig],
['nuxt-simple-sitemap', sitemapConfig],
['nuxt-jsonld', jsonldConfig],
['nuxt-simple-robots', robotsConfig],
'nuxt-typed-router',
['@vite-pwa/nuxt', pwaConfig],
],
//i18n config
import { type ModuleOptions } from '@nuxtjs/i18n'
const config: ModuleOptions = {
defaultLocale: 'en-US',
langDir: 'config/i18n/locales/',
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en-US.json',
},
{
code: 'ar',
iso: 'ar-JO',
file: 'ar-JO.json',
},
],
lazy: true,
strategy: 'prefix'
}
export default config
The text was updated successfully, but these errors were encountered: