Turbopack import JSON from outside project root
Unanswered
Spinge Bib Sqorpnts posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/332567411620577280/dd5f9fddf3e5dcb6102949df26064d7b.webp?size=256)
Spinge Bib SqorpntsOP
Hello, I am attempting to import a JSON file that resides outside the project folder, and it works perfectly without the
Snippet:
locale is a state string.
--turbo
flag.Snippet:
locale is a state string.
import(`C:/inetpub/wwwroot/Translation/${locale}.json`)
.then((msgs) =>
{
setMessages(msgs.default);
})
.catch((e) => console.error('Failed to load messages:', e));
2 Replies
![Avatar](https://cdn.discordapp.com/avatars/332567411620577280/dd5f9fddf3e5dcb6102949df26064d7b.webp?size=256)
Spinge Bib SqorpntsOP
When I run
next dev --turbo
, it throws a Module not found
error![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
If it works without turbopack and fails with turbopack, that’s turbopack’s bug so (1) please report it as a bug and (2) you can’t do anything other than going back to webpack