-
-
Notifications
You must be signed in to change notification settings - Fork 163
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 find module 'blahblahblah.js' #28
Comments
i am able to require npm modules but not custom built modules. |
Hi @aryeharmon! Thanks for opening the issue. One question: What exactly do you mean by "custom built modules"? |
@andywer modules i have made. (not using npm modules) |
Like Btw: Are you experiencing those troubles in node or in the browser (using webpack, browserify or such)? |
yes, i found the issue. apparently the path inside the thread is not the same path as my app. |
in node |
Nice to hear that it's already solved. Not sure if the documentation needs to be improved though... |
I am having the same issue. What was the solution you found to get |
@pietrop i passed __dirname to the thread so that i can use it.
|
@andywer yes, i think we should update the documentation |
I totally agree! Added a FAQ section to the README: https://github.com/andywer/threads.js#faq-frequently-asked-questions Thanks for your feedback @aryeharmon @pietrop! :) |
Error: Cannot find module '/server/utilidades.js' .. also? |
@alejanrosofter send a code snippet, did you pass the dirname to the worker? |
yes this is error log: and this is part my code: const thread = spawn(function(input, done) { thread .send({doc:doc,hola:"see",__dirname: __dirname}) |
what is your project file structure? are you sure '/server/utilidades.js' exists? |
app ---->server ---->lib i make thread from _generarDeuda.js |
I guess somewhere you have a |
not seem require.. andywer can pass the proyect from codeanywhere (without obligation) with your email |
Tried...
Getting webpack_require is not defined. Any suggestions for how to use with webpack? |
Hey @brennanerbz. Yeah, that won't work. You can create a small separate bundle for |
@andywer is there any way to not create a separate bundle? |
@brennanerbz I don't think there is a way around it. Since the function you pass to Sorry for the bad news 😕😉 |
@andywer I removed webpack as a dependency, and it works now. Also, do you have any links to projects using this in the wild? I want to see a more complete example. |
@brennanerbz Not really, but you can check out https://www.npmjs.com/browse/depended/threads |
PS: Nice to see you got it working :) What do you mean by removed webpack as a dependency? |
i have the following script:
var thread = spawn(function(input, done) {
var blahblah = require('./inc/blahblahblah.js');
});
i am not being able to import modules from within the process.
Error: Cannot find module
The text was updated successfully, but these errors were encountered: