Skip to content
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

Can't resolve 'webserver' #66

Open
johanneswilm opened this issue May 8, 2019 · 7 comments
Open

Can't resolve 'webserver' #66

johanneswilm opened this issue May 8, 2019 · 7 comments

Comments

@johanneswilm
Copy link

Hey,
when packing our site with webpack which depends on texzilla, we run into #53 . If we then add "system" as a dependency, we get this warning message instead:

Module not found: Error: Can't resolve 'webserver' in './node_modules/texzilla'
 @ ./node_modules/texzilla/TeXZilla.js
...

It seems like both this issue and #53 still need to be fixed. In #53 it sounds like you are not planning to fix it here - so maybe somewhere else?

@fred-wang
Copy link
Owner

I was not able to reproduce the error last time I tried. I think someone who can should probably investigate the cause and try and propose a patch for this.

@johanneswilm
Copy link
Author

I can see a require("webserver") that is in a try block [1], which is likely why this is a warning and not an error. And at least two references to system [2][3].

[1] https://github.com/fred-wang/TeXZilla/blob/master/commonJS.js#L181

[2] https://github.com/fred-wang/TeXZilla/blob/master/commonJS.js#L233

[3] https://github.com/fred-wang/TeXZilla/blob/master/commonJS.js#L249

@fred-wang
Copy link
Owner

So should https://github.com/fred-wang/TeXZilla/blob/master/package.json contains something more? I'm not very familiar with NPM

@johanneswilm
Copy link
Author

Looking at this list of suggestions [1], I found that if I replace all occurrences of require("system") with window.require("system") and require("webserver") with window.require("webserver") solves the issue for the packager. @fred-wang Will that also work when using it in the kinds of environments where these packages are available by default?

[1] https://stackoverflow.com/questions/34828722/how-can-i-make-webpack-skip-a-require

@johanneswilm
Copy link
Author

It seems like the fundamental issue here is that you use the same file as an import for other websites and the same file to run as a command line program. So it's choking on the bits that are only meant for commandline usage. Is that a fair assessment, @fred-wang ?

@fred-wang
Copy link
Owner

that's possible. I would need to check in details :-)

@johanneswilm
Copy link
Author

excellent. I hope to see a solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants