-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"npm install oltb" issue #42
Comments
Hi @gokhanax These problems can be a bit tricky. The history of TS/JS and the different types of build systems has brought us here. But they usually can be fixed in some way. When installing OLTB through "npm install oltb" other packages will also be installed (those specified under dependencies in package.json in OLTB). Step 1:
Step 2: Step 3: Try adding this configuration to tour configuration.
More info here: Can you share more info about your project:
Right now OLTB is written in vanilla js. Sometimes a little more configuration is required when you want to use this in a typescript project. Eventually I will lift everything to TypeScript, but not in the next few months. |
Hi @qulle Thank you very much for your response. I will try again, paying attention to the points you mentioned. Additionally, would it be possible for you to share a sample React project with npm added? Best regards. |
Yes i can add one example for React and one for Angular. Any progress on your issue? |
"I am adding it to my React project with
npm install oltb
and following the examples in thenpm
directory within the examples directory. However, it still throws numerous errors like the ones below. When used as an npm package, there seems to be an issue with the references."ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 2:0-37
Module not found: Error: Can't resolve 'ol/proj' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'proj.js'?
BREAKING CHANGE: The request 'ol/proj' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 3:0-96
Module not found: Error: Can't resolve 'ol/interaction' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'interaction.js'?
BREAKING CHANGE: The request 'ol/interaction' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 4:0-113
Module not found: Error: Can't resolve 'ol/events/condition' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'condition.js'?
BREAKING CHANGE: The request 'ol/events/condition' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 7:0-41
Module not found: Error: Can't resolve './browser-prototypes/json-cycle' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'json-cycle.js'?
BREAKING CHANGE: The request './browser-prototypes/json-cycle' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 8:0-37
Module not found: Error: Can't resolve './browser-prototypes/string' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'string.js'?
BREAKING CHANGE: The request './browser-prototypes/string' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 9:0-43
Module not found: Error: Can't resolve './browser-prototypes/slide-toggle' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'slide-toggle.js'?
BREAKING CHANGE: The request './browser-prototypes/slide-toggle' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 13:0-52
Module not found: Error: Can't resolve './ui-common/ui-toasts/toast' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'toast.js'?
BREAKING CHANGE: The request './ui-common/ui-toasts/toast' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 14:0-52
Module not found: Error: Can't resolve './ui-common/ui-modals/modal' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'modal.js'?
BREAKING CHANGE: The request './ui-common/ui-modals/modal' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 15:0-55
Module not found: Error: Can't resolve './ui-common/ui-dialogs/dialog' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'dialog.js'?
BREAKING CHANGE: The request './ui-common/ui-dialogs/dialog' 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.
ERROR in ./node_modules/oltb/src/oltb/js/oltb.js 16:0-56
Module not found: Error: Can't resolve './browser-constants/settings' in 'D:\Users\Gokhan\reactoltb\my-app\node_modules\oltb\src\oltb\js'
Did you mean 'settings.js'?
BREAKING CHANGE: The request './browser-constants/settings' 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.
...
The text was updated successfully, but these errors were encountered: