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

Include process.cwd() while resolving module for view engine #526

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

sumeetkakkar
Copy link
Contributor

Include process.cwd() while resolving module for view engine.

Before this change, if kraken-js was deployed outside the app's directory, it was not able to resolve view-engine modules deployed under app's node_modules directory.

Added unit test to test this case.

…sible that krakenjs module is deployed outside application root
return require.resolve(modulePath, { paths });
} catch (e) {
if (e.code === 'MODULE_NOT_FOUND')
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when will this happen? and why are we silencing this error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind. I see you have a check in Line 58

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will throw later throw new TypeError( Module ${spec.module} not found ); LINE#59

@sumeetkakkar sumeetkakkar merged commit 0c9e085 into krakenjs:v2.x Nov 23, 2021
@sumeetkakkar sumeetkakkar deleted the topic/resolve-module branch November 23, 2021 18:52
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

Successfully merging this pull request may close these issues.

None yet

3 participants