Open JoBerkner opened 4 years ago
Unfortunately I do not have any experience with React Native or Expo. Typically the bundlers find the library or can be tweaked to find it.
With "geotiff": "1.0.0-beta.10"
I have the same problem in Angular 9, but fixed it by importing like this:
import * as GeoTiff from 'geotiff';
I also get this warning when compiling for Angular Universal for SSR, could be related:
WARNING in ./node_modules/geotiff/dist-browser/main.js 1:292-296
Critical dependency: the request of a dependency is an expression
I also get this warning when compiling for Angular Universal for SSR, could be related:
WARNING in ./node_modules/geotiff/dist-browser/main.js 1:292-296 Critical dependency: the request of a dependency is an expression
This is due to the browser
field in package.json that I've added in #131. It is not properly defined and should be fixed by #144.
Can you tell me if the PR fixes the issue for you Angular build ? Note that you need to add the threads-plugin
to your webpack config if you are using GeoTIFF.Pool
(see: https://github.com/geotiffjs/geotiff.js/pull/144/files#diff-04c6e90faac2675aa89e2176d2eec7d8R301-R315).
It may also fixes the import issue depending on the configuration of your project.
@JoBerkner @PacoDu do you think we can close this issue now? (I'm not a React native user)
@constantinius yes, I think the solution provided by @philip-firstorder works (did not test it though, but I know of an exact same issue with another library in React Native). I will test it today one .ore time once I am on my PC.
Im getting compile errors on nuxtjs, not sure if related
ERROR Failed to compile with 2 errors friendly-errors 21:52:42
This dependency was not found: friendly-errors 21:52:42
friendly-errors 21:52:42
* fs in ./node_modules/geotiff/src/source.js, ./node_modules/txml/tXml.js friendly-errors 21:52:42
friendly-errors 21:52:42
To install it, you can run: npm install --save fs friendly-errors 21:52:42
``
I'm with the same issue with nextjs 14. I already tried the @philip-firstorder solution and it not worked =(
I think this issue is more React Native related, but perhaps somebody knows how to solve this. I am building a React Native app using Expo and installed geotiff using:
npm install geotiff --save
However, when I try to import it in my React Native project:
import GeoTIFF from 'geotiff'
I am getting the error:
However, when trying to get it from command line it works:
Does anybody know how to resolve this? I tried the solution that was provided in #46, but it did not change anything.
46