question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Existing VueJS 3 project

See original GitHub issue

Looks like there is some issue with using Trois in projects that already exist. I tried both the import and declare in main process as well as the direct import in the component and I get the same error both ways. I did download the starter app and that worked but I’m more interested in including Trois in my own bundle. I looked up the error in the source and it apparently has something to do with the intersect function. I did try adding Vite and ViteJS plugin-vue to no effect. The error says something about not having a proper loader but I’m not sure that is what the issue is since I tried Vite and it seems the start app is a pretty barebones implementation.

error  in ./node_modules/troisjs/build/trois.module.js

Module parse failed: Unexpected token (128:34)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|           onIntersectOver(overEvent);
|           onIntersectEnter(enterEvent);
>           component.onPointerOver?.(overEvent);
|           component.onPointerEnter?.(enterEvent);
|         }

 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/router/views/Home.vue?vue&type=script&lang=js 3:0-84 9:9-12 10:12-18 11:21-36 12:16-26 13:14-22 14:11-16
 @ ./src/router/views/Home.vue?vue&type=script&lang=js
 @ ./src/router/views/Home.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.1.113:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
klevroncommented, Apr 28, 2021

Can you try with 0.3.0-beta.0 ? It should be ok now : https://bundlephobia.com/result?p=troisjs@0.3.0-beta.0

2reactions
klevroncommented, Apr 27, 2021

This will be fixed soon, I will use rollup-plugin-esbuild (and a lower target) for the next release

https://github.com/troisjs/trois/commit/3131469fc2522d1bd03e019018ef727230c511d4

Read more comments on GitHub >

github_iconTop Results From Across the Web

How-to Guide: Adding VueJS to Your Existing Project
Step 1: Evaluate and start the implementation · Step 2: Vue Components to the rescue! · Step 3: Template System · Step 4:...
Read more >
Adding Vue.js to an Existing Project | by Blunt Jackson | Medium
When creating our application, we instantiate a new Vue object, and, in this case we provide it with two keys: el tells vue...
Read more >
Quick Start | Vue.js
This command will install and execute create-vue, the official Vue project scaffolding tool. You will be presented with prompts for several optional ...
Read more >
Install And Run The Vue JS 3 Project Using Vue CLI [2022]
Install Node.js & NPM package · Install Vue CLI 4.5 or higher · Create A Vue 3 Project · Run Vue 3 Web...
Read more >
Creating Your First Vue 3 Project - A Vue Tutorial
There are a few different options for adding Vue 3 to your existing projects or creating your very own Vue 3 project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found