Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source maps make build fail when including source from outside the directory

See original GitHub issue

Hi! I’m trying out severless-bundle and it seems to do wonders! Thank you.

My Lambda includes a function from outside the Lambda folder, like so: const myForeignFunction = require("../library/index");

As long as I set sourcemaps: false, it all works like a charm. I can deploy the Lambda, and Webpack makes the foreign function available. But, if I want my sourcemaps enabled (which I do…), sls deploy fails with this error:

ERROR in /home/user/Projects/myproject/library/index.js
Module not found: Error: Can't resolve 'source-map-support/register' in '/home/user/Projects/myproject/library'

What am I doing wrong? Is this not the Right Way to include code from outside the Lambda directory?

Thank you!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

mpaccionecommented, Sep 23, 2021

I’d like to know as well I am experiencing the same issue!

nuwan-swivelcommented, Dec 12, 2022

Any update on this? Having the same issue when importing functions from outside the directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

After Upgrading to CRA 5.0 getting a lot of: Failed to parse ...
The best solution is to open a issue or pullrequest on that packages. The warnings are correct. These packages source maps pointing to...
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
Missing original source files​​ This likely means that your source map doesn't contain or link to your original source files. Without your ...
Read more >
Failed to parse source map - Stack Overflow
In the node_modules folder I have the @AAA/BBB folder with /dist/cjs and /dist/esm. I dont know what can produce the search in /src...
Read more >
Should I Use Source Maps in Production? | CSS-Tricks
A “source map” is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to the original authored version....
Read more >
Improving Development with Source Maps for Debugging
With source maps, we can trace the error back to our code, making it ... a deal to locate the source of that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found