Comments (4)
Hey, it's a TS file. The issue seems to be that both index.d.ts and index.ts have a default export of an object literal. I'm not sure if deconstructing default exports is valid synxtax. Named exports would be better here, like:
export ARToolkitNFT from "./ARToolkitNFT";
export ARControllerNFT from "./ARControllerNFT";
So currently this works with the default export:
import artools from '@webarkit/jsartoolkit-nft';
const {ARToolkitNFT, ARControllerNFT } = artools;
Codesandbox Demo of the issue: https://codesandbox.io/s/confident-engelbart-o1idk3?file=/src/index.ts
from jsartoolkitnft.
Hi @timohausmann i have never had this issue, i can import it into ARnft without any problems. Probably a Vite issue? I have no experience with It so i can not say so much. Just a question are you trying to import in a JavaScript file or Typescript?
from jsartoolkitnft.
@timohausmann you should add more infos about the issue and if possible a link to a repository with a minimal example to test. Thank you! 🙂
from jsartoolkitnft.
Hey, it's a TS file. The issue seems to be that both index.d.ts and index.ts have a default export of an object literal. I'm not sure if deconstructing default exports is valid synxtax. Named exports would be better here, like:
export ARToolkitNFT from "./ARToolkitNFT"; export ARControllerNFT from "./ARControllerNFT";So currently this works with the default export:
import artools from '@webarkit/jsartoolkit-nft'; const {ARToolkitNFT, ARControllerNFT } = artools;Codesandbox Demo of the issue: https://codesandbox.io/s/confident-engelbart-o1idk3?file=/src/index.ts
Yes you are right youn need to import in this way:
import artools from '@webarkit/jsartoolkit-nft';
const {ARToolkitNFT, ARControllerNFT } = artools;
I should update the Readme, but i'm going to make some changes and improvements to the C++ and Typescript code.
In regards of the question if deconstructing default exports is valid synxtax.
probably is not strictly valid, so maybe better to use the named export. If you are interested i'm working on this feature in this PR #301
from jsartoolkitnft.
Related Issues (20)
- Missed libar debug lib
- Code enhancement: add interfaces IARToolKitNFT and IARControllerNFT HOT 1
- loadNFTMarker and loadNFTMarkers in ARControllerNFT.ts are not updated
- remove artoolkitNFT gloabl variable
- Check if deleteCamera exist
- matrixCopy is not required
- Issue with github-action: set-output is deprecated.
- simd vectorization need also other flags?
- Node.js 12 actions are deprecated. - github action warning.
- Image tracking video with worker examples needed. HOT 2
- Examples not working HOT 4
- About version 1.6.0 wrong version displayed HOT 1
- Marker Detection problem in new versions HOT 8
- Verify if detectMarker is strictly needed HOT 1
- emsdk 3.1.50 cause builds errors HOT 1
- emsdk 3.1.40 output stderr printf message as log error messages.
- Implement ThreeJS Interactive + multiple NFT
- Threaded examples not working on mobile browser HOT 3
- Marker detection problem after the first time HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsartoolkitnft.