import locale in SvelteKit/NodeJS
See original GitHub issuei tried the following combinations:
- import { de } from ‘date-fns/locale/index.js’
- import { de } from ‘date-fns/locale’
- import { de } from ‘date-fns/esm/locale’
- import { de } from ‘date-fns/esm/locale/index.js’
all of them bring this or a similar error:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '.../node_modules/date-fns/locale/de' is not supported resolving ES modules imported from .../.svelte-kit/output/server/entries/pages/moral.svelte.js
How can i get this to work please?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Svelte i18n Internationalization: how to localize a Svelte app
Add a new i18n.js file inside it with this code: import {. dictionary,. locale,. _. } from 'svelte-i18n';. function setupI18n({.
Read more >A Step-by-Step Guide to Svelte Localization | Phrase
First, let's expose svelte-i18n's locale store through our own wrapper library. /src/services/i18n.js. import ...
Read more >Loading data • Docs • SvelteKit
A +page.svelte file can have a sibling +page.js (or +page.ts ) that exports a load function, the return ... import * as db...
Read more >Svelte Quick Tip: Adding basic internationalization (i18n) to ...
Tagged with svelte, i18n, javascript, webdev. ... App.svelte --> <script> import { t, locale, locales } from "./i18n"; // Create a locale ......
Read more >Is it possible to access Svelte store from external js files?
Imagine pstats = {uid: 1, locale: 5} ... import { pstats} from './stores.js' export async function leave_locale() ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
seems i got it to work with:
import de from 'date-fns/locale/index.js'
esm problem