#community-help

Troubleshooting Typesense UI Build Errors

TLDR Black was encountering errors when trying to build a Typesense UI on an Oracle VM instance. Despite Jason's suggestions to change parcel versions and check node versions, the issue remained unresolved. Black decided to try in a new VM instance.

Powered by Struct AI
Nov 13, 2022 (11 months ago)
Black
Photo of md5-c1425339d7fdd39dd9574c2155e86a06
Black
02:09 PM
Hi, I've tried the tuto about building an UI for typesense with the help of this doc : https://typesense.org/docs/guide/search-ui-components.html (all into an Oracle instance)
But I got some errors after the npm start :
> ubuntu@instance-20221112-1515:/typesense/typesense-instantsearch-demo$ sudo npm start
>
> > [email protected] start
> > parcel index.html --port 3000
>
> Server running at http://localhost:3000
> 🚨 Build failed.
>
> @parcel/transformer-js: Browser scripts cannot have imports or exports.
>
> /typesense/typesense-instantsearch-demo/src/app.js:1:1
> > 1 | import TypesenseInstantSearchAdapter from "typesense-instantsearch-adapter";
> > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2 |
> 3 | const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
>
> /typesense/typesense-instantsearch-demo/index.html:44:3
> 43 |
> > 44 | <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearch-lite.umd.js"></script>
> > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The environment was originally created here
> 45 | <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
> 46 | <script src="./src/app.js"></script>
>
> 💡 Add the type="module" attribute to the <script> tag.
> 📝 Learn more: https://parceljs.org/languages/javascript/#classic-scripts
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:16 PM
Could you try using parcel v1, instead of parcel v2?
Black
Photo of md5-c1425339d7fdd39dd9574c2155e86a06
Black
02:20 PM
the 1.12.4 for example ?
02:22
Black
02:22 PM
I got a different error :
> ubuntu@instance-20221112-1515:/typesense/typesense-instantsearch-demo$ sudo npm start
>
> > [email protected] start
> > parcel index.html --port 3000
>
> Server running at http://localhost:3000
> 🚨 /typesense/typesense-instantsearch-demo/favicon.png: Invalid Version: undefined
> at new SemVer (/typesense/typesense-instantsearch-demo/node_modules/@babel/preset-env/node_modules/semver/semver.js:314:11)
> at compare (/typesense/typesense-instantsearch-demo/node_modules/@babel/preset-env/node_modules/semver/semver.js:647:10)
> at Function.lt (/typesense/typesense-instantsearch-demo/node_modules/@babel/preset-env/node_modules/semver/semver.js:688:10)
> at /typesense/typesense-instantsearch-demo/node_modules/@babel/preset-env/lib/index.js:225:11
> at Object.default (/typesense/typesense-instantsearch-demo/node_modules/@babel/helper-plugin-utils/lib/index.js:31:12)
> at getEnvPlugins (/typesense/typesense-instantsearch-demo/node_modules/parcel/src/transforms/babel/env.js:62:34)
> at getEnvConfig (/typesense/typesense-instantsearch-demo/node_modules/parcel/src/transforms/babel/env.js:12:25)
> at async getBabelConfig (/typesense/typesense-instantsearch-demo/node_modules/parcel/src/transforms/babel/config.js:32:19)
> at async babelTransform (/typesense/typesense-instantsearch-demo/node_modules/parcel/src/transforms/babel/transform.js:6:16)
> at async JSAsset.pretransform (/typesense/typesense-instantsearch-demo/node_modules/parcel/src/assets/JSAsset.js:83:5)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:23 PM
Could you try with node 12?
02:23
Jason
02:23 PM
If not, then node 14?
Black
Photo of md5-c1425339d7fdd39dd9574c2155e86a06
Black
02:25 PM
my actual is v12.22.9
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:30 PM
Hmmm not sure what’s happening. May I know what OS you’re on? I can take a look this coming week
Black
Photo of md5-c1425339d7fdd39dd9574c2155e86a06
Black
02:36 PM
I can have a healthcheck for ts "core", I'm now trying to build the ui
02:36
Black
02:36 PM
Canonical-Ubuntu-22.04-aarch64-2022.11.06-0 on a Oracle VM instance
Nov 14, 2022 (11 months ago)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:37 PM
I can’t seem to replicate the issue… Could you try deleting the node_modules folder, and/or starting afresh with a fresh clone? and also try uninstalling any global installation of parcel / parcel-bundler?
Nov 19, 2022 (11 months ago)
Black
Photo of md5-c1425339d7fdd39dd9574c2155e86a06
Black
10:47 AM
Ok, I will try on a new VM instance instead.