"no lockfile entry" while importing remote JSON over http

32 Views Asked by At

I have a NextJS v12 app where I'm trying to import json file from my remote host, like this

const importJson = async () => {
    // @ts-ignore
    return await import("https://my-host.com/blablabla/file.json");
}

But during build I got this error:

Module not found: https://my-host.com/blablabla/file.json has no lockfile entry and lockfile is frozen
   5 |
   6 |     // @ts-ignore
>  7 |     return await import("https://mf-dev.smile2impress.com/dev1/price-block-widget/v1/prices.json");
     |                 ^
   8 | }
   9 |

File is 100% accessible, and the error message says nothing to me. I have no clues how to fix this, maybe you know?

My setup: Node v18, npm v10 / yarn v1, NextJS v12, TS v4.9.4

0

There are 0 best solutions below