Share feedback, ideas and get community help

Updated last year

Typebot react v0.2.28

Hi everyone, I've been trying to embed Typebot with React, but there's a problem with libraries on v0.2.28. Once I do the npm start command, I get this compilation error:

BREAKING CHANGE: The request '@typebot.io/js/dist/web' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

with v0.1.27 (last one I tried) it's not happening, but I get an error with the multichoice options that avoids my typebot interaction to continue... Do you have any working examples with the latest library?

Kind regards!
B
b
4 comments
Hi Baptiste! Thanks for your help and your example. Applying dependencies in that example, error changed:

./node_modules/@typebot.io/js/dist/web.js 931:14
Module parse failed: Unexpected token (931:14)
File was processed with these loaders:
  • ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| De = e => null == e

"" === e,
| je = e => null != e && "" !== e,

Fe = e => e?.startsWith("data:image/svg")

e?.endsWith(".svg"),
| Ue = e => {
| e = e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (e, t, n, o) => t + t + n + n + o + o);
I was able to solve it, @Baptiste ! Just for you to know and if there's someone else with the same problem, I followed this instructions:
1.Edit the browserlist section in package.json from this:
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},

To this:

"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],


  1. delete "node_modules/.cache" directory.
  2. npm install at the root of the project.
  3. npm start
Voilá
Add a reply
Sign up and join the conversation on Discord