question-mark
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.

doesn't work when bundled

See original GitHub issue

Because of this line the sql file ends up checking the relative location in this case it’s dist instead of node_modules. Maybe inline this so it can be bundled? Or allow using the one supplied by the user.

https://github.com/ThomWright/postgres-migrations/blob/bc2b0cbe91824fc18a473cba9b80179536cefeef/src/files-loader.ts#L35

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
OmgImAlexiscommented, Oct 26, 2021

It’s usually done for embedded apps and/or serverless like aws lambda. I’m honestly surprised this hasn’t come up in the past.

Usually with rollup the __dirname will be rewritten to the base directory, thing is that’s not going to help in this case as the file isn’t in the base directory it’s in node_modules.

I have a feeling the new way of getting __dirname might work in this case.

const __dirname = path.dirname(new URL(import.meta.url).pathname);
1reaction
mishabrumlcommented, Jun 10, 2022

You could try e.g. path.join(process.cwd()) from evanw/esbuild#859 (comment)

I would be surprised if that worked in a normal Node.js/NPM environment.

Perhaps you would like to try it?

I will try and get some time

I see you’re also based in Bristol, hi!

I was gonna say the same thing 😀 Wasson me babber!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET MVC Bundle not rendering script files on staging ...
I used Identity2 then Scripts didn't load for anonymous user then I add this code in webconfig and Sloved. <location path="bundles"> <system.web> ...
Read more >
MVC Bundle Not Working with Release Configuration (Debug ...
Below is the bundling code. If debug is true, it work perfectly. If I set it false, none of them load. Please help...
Read more >
ASP.NET MVC: Bundle not rendering - My Tec Bits
UPDATE (26th Aug 2016): I've figured out the reason, why the bundles were not rendering for me before using bundles.IgnoreList.Clear(). It's ...
Read more >
Bundling not working in Sitecore MVC
I just had this happen, the issue is that Sitecore is picking on the bundling URL. Need to add your /bundles/css to the...
Read more >
My webpack bundle.js is not being found - r/learnjavascript
I have main.js and all its dependencies being bundled into bundle.js. Bundle.js is then the sole script being loaded by my HTML file, ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found