-
Notifications
You must be signed in to change notification settings - Fork 100
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
Cannot resolve module 'fs' #27
Comments
Hi @cancan101 Thank you for using main.js const tiff = require('tiff.js');
console.log(tiff); webpack.config.js module.exports = {
target: 'web',
entry: './main.js',
output: {
filename: 'bundle.js',
},
node: {
fs: 'empty',
},
}; |
yes, that works! |
angular/angular-cli#9827 @seikichi can you help me in creating a separate file for browser environment? and then it can referenced in package.json like this: {
"browser": "tiff.browser.js",
"typings": "tiff.d.ts"
} |
Hot fix, just add it to the "package.json":
|
Hi @seikichi , it throws following error, I tried all the above comments its not working. |
Same issue as @thangaraj80 . |
@RockGuitarist1 , look here #27 (comment)
|
@pakhuta I tried adding this in my package.json with no luck:
|
@RockGuitarist1 if you use webpack watch you should stop it and rerun build. If it doesn't help you, sorry, I don't know how to help you. |
@pakhuta Angular 6 with Angular CLI, just like thangaraj80. |
try using tiff.js for client side, add in assets folder
Thanks,
Thangaraj.S
My Photography
http://500px.com/thangaraj80
http://www.flickr.com/photos/thangaraj80/
…On Fri, Jul 6, 2018 at 7:58 PM Joshua Ballas ***@***.***> wrote:
@pakhuta <https://github.com/pakhuta> Angular 6 with Angular CLI, just
like thangaraj80.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARCygCu9syxL0pPFIHcyfA4meqtCywrvks5uD3QYgaJpZM4QD6FF>
.
|
I tried loading through assets folder as well ERROR in src/app/app.component.ts(12,25): error TS2307: Cannot find module 'assets/tiff.min.js'.
ERROR in src/app/app.component.ts(13,10): error TS2339: Property 'initialize' does not exist on type 'Promise<any>'. I posted the same issue in Angular CLI repository. angular/angular-cli#11944 |
importScripts("../assets/js/tiff.js");
Tiff.initialize({});
Thanks,
Thangaraj.S
My Photography
http://500px.com/thangaraj80
http://www.flickr.com/photos/thangaraj80/
…On Wed, Aug 22, 2018 at 6:17 PM Prabhdeep Singh ***@***.***> wrote:
I tried loading through assets folder as well
[image: screen shot 2018-08-22 at 8 44 01 am]
<https://user-images.githubusercontent.com/13006107/44464045-a63f6100-a5e7-11e8-829a-e68cf6ae1bf9.png>
ERROR in src/app/app.component.ts(12,25): error TS2307: Cannot find module 'assets/tiff.min.js'.
ERROR in src/app/app.component.ts(13,10): error TS2339: Property 'initialize' does not exist on type 'Promise<any>'.
I posted the same issue in Angular CLI repository.
angular/angular-cli#11944
<angular/angular-cli#11944>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARCygK92ABzZOXzwwJwiD8a_5fBhxzJ_ks5uTVLlgaJpZM4QD6FF>
.
|
Hi, Did someone found a solution or a workaround ? I'have tried a lot of solutions but none of these worked... Simon |
I have tried everything here that I could for my Angular CLI and it has not worked. I found this guide but it did not work either. Would love to hear a fix. will post back if i find anything. I'm just trying to render a tiff in the browser. |
Add tiff.js in angular.json importScripts(input.protocol + input.host +"/assets/tiff.min.js"); load your tiff files using |
thank you for your reply @thangaraj80, i ended up yesterday converting the tiff images to jpg on the database side. |
Is there a reason this hasn't been added to the repo permanently? |
I am using webpack to built a bundle that has tiff.js. I have not installed fs as I plan to use in browser however I see the following warning / error:
The text was updated successfully, but these errors were encountered: