useful-bronze
useful-bronze16mo ago

Cannot use import statement outside a module

Getting the following error using the voiceflow/react-chat library:
/Users/user/dev/site/fe/node_modules/@voiceflow/react-chat/build/index.es.js:1
import * as Fe from "react";
/Users/user/dev/site/fe/node_modules/@voiceflow/react-chat/build/index.es.js:1
import * as Fe from "react";
7 Replies
useful-bronze
useful-bronzeOP16mo ago
Extremely basic chat component in my frontend https://pastebin.com/j92Ld1j3 @Tico | Voiceflow Assistant any advice? @W. Williams (SFT) Is it OK if I tag you like this? managed to get the components working like so:
const Launcher = dynamic(
() => import("@voiceflow/react-chat").then((mod) => mod.Launcher),
{
ssr: false,
},
);
const Launcher = dynamic(
() => import("@voiceflow/react-chat").then((mod) => mod.Launcher),
{
ssr: false,
},
);
but not for useRuntime Cannot use import statement outside a module if trying to require() or import it otherwise I get "useRuntime is not a function" if trying to import dynamically
W. Williams (SFT)
I'm not gonna lie, I haven't look at the react-chat in forever. Let's see if @MikeG knows.
generous-apricot
generous-apricot16mo ago
Ye the following
No description
generous-apricot
generous-apricot16mo ago
d15bb6d1c44ccaa3d4d743bbae02d2675a03146a
d15bb6d1c44ccaa3d4d743bbae02d2675a03146a
@Deleted User
useful-bronze
useful-bronzeOP16mo ago
OK thanks Ill try that Do you hav a version number? I'm installing it as an NPM package in a nextjs repo
generous-apricot
generous-apricot16mo ago
no clue unfortunately, I set it up before all this happened
useful-bronze
useful-bronzeOP16mo ago
Ill wait for alex' reply @SuperZooper just trying to use this as a package in a nextjs app and getting some errors anyone?

Did you find this page helpful?