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.

Can't resolve ~db or ~imports

See original GitHub issue

Bug Report

Describe the bug I have the feeling that after this commit I can’t run docz anymore: https://github.com/pedronauck/docz/commit/6d9bb2507b3a23aff825a1a2efd53bcdc8080240#diff-1e7a151ea59cd3f5090a28e374906791

It shows me this error;

These dependencies were not found:

* ~db in ./node_modules/docz/dist/index.m.js
* ~imports in ./node_modules/docz/dist/index.m
.js

To install them, you can run: npm install --sa
ve ~db ~imports

I tried already re-installing all node modules and deleting cache, but that didn’t work. It seems to be broken from version 0.12.10 and up. 0.12.9 is still working.

A clear and concise description of what the bug is. Docz won’t start.

Environment Mac OSX Mojave. Node 8.11.3 Npm 6.3.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pedronauckcommented, Dec 13, 2018

You need to merge your alias with the docz default aliases. Use something like webpack-merge is a good option to prevent errors 😃

1reaction
psullivan6commented, Jan 1, 2019

An additional solution that I’ve found is to do an Object.assign with the existing docz aliases and my desired custom aliases like so:

const aliases = require('./path-to-custom/aliases');

export default {
  modifyBundlerConfig : (config) => {
    // Combine the default docz aliases with our custom aliases from an external file
    config.resolve.alias = Object.assign({}, config.resolve.alias, aliases);
    return config;
  }
};

For my particular project, logging config.resolve.alias within the modifyBundlerConfig function yields:

{
  '~db': '[PROJECT_ROOT]/.docz/app/db.json',
  '~imports': '[PROJECT_ROOT]/.docz/app/imports.js',
  'react-native$': 'react-native-web'
}

showing that the alias object is setup with these “defaults” and thus custom aliases need to be added on via Object.assign or similar.

While the webpack-merge is probably the better solution for a more robust build, this works for something a bit smaller.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot import Database Access Key - Blackmagic Forum
So each person imported the access keys of the other stations into their DaVinci Resolve. Everything worked fine. For a single station only, ......
Read more >
How to establish Cosmos DB database connection with nestjs ...
I'm trying to import the Cosmos DB connection module in nestjs v9, but I'm getting dependencies errors. Nest can't resolve dependencies of ...
Read more >
Working with Data - MongoDB
I am currently receiving an error which I understand to be because of a missing util directory within the react app I am...
Read more >
[now-next] Module not found: Can't resolve 'request' when ...
I just copied your code, it worked as expected. Then I added import firebase from 'firebase/app'; import 'firebase/database' , it breaked. 2019- ...
Read more >
Troubleshooting for Amazon RDS - AWS Documentation
Use the following sections to help troubleshoot problems you have with DB instances in Amazon RDS and Amazon Aurora. Topics. Can't connect to...
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