Closed Dragoy closed 3 months ago
It depends on your environment (e.g., package.json, package bundler, etc.). Can you provide a minimal reproducible environment for this issue?
Yes of course, I use this template for creative coding (https://github.com/mattdesl/canvas-sketch/) and decided to add a library for controllers.
The contents of my package.json:
{
"name": "my-sketches",
"version": "1.0.0",
"description": "",
"main": "sketch.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Dragoy",
"license": "ISC",
"type": "module",
"dependencies": {
"canvas-sketch": "^0.7.7",
"dat.gui": "^0.7.9",
"recordrtc": "^5.6.2",
"three": "^0.147.0",
"tweakpane": "^4.0.4"
},
"devDependencies": {
"@tweakpane/core": "^2.0.4"
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": true
}
}
I'm new to web development, maybe I'm doing something wrong
I haven't used canvas-sketch
before, so I don't know the details, but the template seems to have a rather unique project structure. It would be best to ask about how to add libraries to the project in the repository's issues section.
If it doesn't support JS modules, you may have to use the previous major version of Tweakpane (3.x). https://tweakpane.github.io/docs/migration/v4/
Feel free to reopen the issue if you have any updates.
I'm impotrizing tweakpane as a module, and I get this error!
const { Pane } = require('tweakpane');
What can be the problem?