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.

basedir not resolving in dependencies

See original GitHub issue

Correct me if I’m wrong, but setting basedir, I expect to be able to require relatively to this folder, inside the dependencies.

I have a very simple example that I cannot make work, given the following file structure:

js/app.js
js/src/models/Person.js
js/src/views/PersonView.js

(Note: app.js requires PersonView.js)

I would expect to be able to require Person.js from within PersonView.js like so:

var Person = require('./src/models/Person');

Instead of the normal method, relatively to process.cwd():

var Person = require('../models/Person');

But running bundle

var b = browserify('./app', {basedir: './js'});
b.bundle().pipe(process.stdout);

… I get the following error:

Error: module "./src/models/Person" not found from "/Users/..some path.../js/src/views/PersonView.js"

Any hint/help would be much appreciated.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
eightyfivecommented, Mar 20, 2014

@bstst You made my day! @substack How come this is not documented? Can we rely on it?

0reactions
eightyfivecommented, Mar 23, 2014

The paths option is documented in browser-resolve. That makes sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hudson Maven ${basedir} can't find dependency
I have a created a maven repo in a directory called lib in the base of my project. I can use maven to...
Read more >
Maven ${project.parent.basedir} : IDEA-106594 - YouTrack
The ${project. parent. basedir} variable does not resolve in IntelliJ - it is highlighted as an error with the message "Cannot resolve symbol:...
Read more >
Could not resolve dependencies error-Apache Mail Archives
Hi, We have an issue with Maven not finding a certain dependency, anyone able to help this Maven. Keep in mind that I'm...
Read more >
Workspace setup throwing errors in spite of adding RAML ...
Workspace setup throwing errors in spite of adding RAML dependencies in the pom file. Added this dependency in POM file but still getting...
Read more >
Automatic Property Expansion with Spring Boot - Baeldung
This will resolve all the project's properties. We still cannot define properties with dots (e.g. user.name) in the build.gradle, but now we can ......
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