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.

Packages required using relative file paths causes issues when using workspaces

See original GitHub issue

If you have conflicting versions of packages in your project for whatever reason, then requiring them ‘relatively’ is dangerous as the file structure might be different.

For example, in connection-fast at line 15, you have

const { parse, serialize } = require('../../pg-protocol/dist')

This relies on these packages being installed inside the same node_modules folder, which I believe isn’t a safe assumption

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
brianccommented, May 5, 2020

@paprikati good catch - that was hanging out from earlier experiementation…didn’t mean for it to be in the normal require path just yet…either way I have a fix up now!

0reactions
brianccommented, May 5, 2020

yah! I gotta figure out how to support the no-verify ssl option in a perfectly backwards compatible way - I thought I had but…i very very subtly changed it & that broke the native driver so gonna take another pass at this:

https://github.com/brianc/node-postgres/pull/2198

It’s easy to be perfectly backwards compat it just wont look quite as nice…but so it goes. I’ll just need some time to get that updated, work gets hectic in the afternoons so might not have time until tomorrow AM…but release coming soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Having relative paths in .code-workspace files for interpreter ...
The correct solution should be to resolve relative paths in .code-workspace files against the location of the workspace file. 1
Read more >
Workspaces do not work nicely with cross-platform builds
Consequently, advise users that the cross-platform files should be cached using relative paths instead of these shortcuts.
Read more >
Typescript: Working with Paths, Packages and Yarn Workspaces
The issue with NodeJS projects is that there is no means for the compiled Javascript code to recognise Typescript path aliases. To get...
Read more >
open() gives FileNotFoundError/IOError: Errno 2 No such file ...
Most likely, the problem is that you're using a relative file path to open the file, but the current working directory isn't set...
Read more >
Using Workspaces to Share Data between Jobs - CircleCI
Files and directories named in the paths: property of persist_to_workspace will be uploaded to the workflow's temporary workspace relative to the directory ...
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