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

Require Function Warning During Webpack Build #451

Open
Drakmyth opened this issue Jun 19, 2023 · 0 comments
Open

Require Function Warning During Webpack Build #451

Drakmyth opened this issue Jun 19, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Drakmyth
Copy link

Describe the bug
We are integrating our node-based AWS Lambda functions with Lumigo and noticed the following warnings in our pipeline logs. Our functions are written in TypeScript and we are able to reproduce the warnings locally running a simple webpack build. I don't believe we are seeing any adverse behavior due to these warnings, but wanted to surface them so they could be addressed just in case. Our code is for an internal closed-source application, so I'm likely unable to provide specific code or configuration examples, but I am happy to consider any further questions and facilitate any troubleshooting as necessary.

Expected behavior
No warnings during a build.

Runtime details
Node: 19.9.0
Webpack: 5.75.0
Lumigo-node: 1.84.2
Typescript: 4.9.4

Logs

WARNING in ./node_modules/@lumigo/tracer/dist/utils/requireUtils.js 18:83-90
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
    at CommonJsRequireContextDependency.getWarnings (/opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/dependencies/ContextDependency.js:102:18)
    at Compilation.reportDependencyErrorsAndWarnings (/opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/Compilation.js:3132:24)
    at /opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/Compilation.js:2729:28
    at _next2 (eval at create (/opt/atlassian/pipelines/agent/build/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:34:1)
    at eval (eval at create (/opt/atlassian/pipelines/agent/build/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:62:1)
    at /opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:385:11
    at /opt/atlassian/pipelines/agent/build/node_modules/neo-async/async.js:2830:7
    at Object.each (/opt/atlassian/pipelines/agent/build/node_modules/neo-async/async.js:2850:39)
    at /opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:361:18
    at /opt/atlassian/pipelines/agent/build/node_modules/neo-async/async.js:2830:7
 @ ./node_modules/@lumigo/tracer/dist/hooks/mongodb.js 5:21-53
 @ ./node_modules/@lumigo/tracer/dist/hooks/index.js 5:16-36
 @ ./node_modules/@lumigo/tracer/dist/index.js 18:14-32

WARNING in ./node_modules/@lumigo/tracer/dist/utils/requireUtils.js 25:87-94
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
    at CommonJsRequireContextDependency.getWarnings (/opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/dependencies/ContextDependency.js:102:18)
    at Compilation.reportDependencyErrorsAndWarnings (/opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/Compilation.js:3132:24)
    at /opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/Compilation.js:2729:28
    at _next2 (eval at create (/opt/atlassian/pipelines/agent/build/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:34:1)
    at eval (eval at create (/opt/atlassian/pipelines/agent/build/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:62:1)
    at /opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:385:11
    at /opt/atlassian/pipelines/agent/build/node_modules/neo-async/async.js:2830:7
    at Object.each (/opt/atlassian/pipelines/agent/build/node_modules/neo-async/async.js:2850:39)
    at /opt/atlassian/pipelines/agent/build/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:361:18
    at /opt/atlassian/pipelines/agent/build/node_modules/neo-async/async.js:2830:7
 @ ./node_modules/@lumigo/tracer/dist/hooks/mongodb.js 5:21-53
 @ ./node_modules/@lumigo/tracer/dist/hooks/index.js 5:16-36
 @ ./node_modules/@lumigo/tracer/dist/index.js 18:14-32

Additional context
We do have esModuleInterop: true in our tsconfig.json and tsc does not surface any warnings or errors. The above errors only surface when running webpack.

@Drakmyth Drakmyth added the bug Something isn't working label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants