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.

Importing nested files causes dependency error

See original GitHub issue

When importing a repository from github, I have two issues that have been troubling:

DevDependencies are not imported

When the package.json file is imported, it’s clearing everything except for the dependencies entry. This causes problems when importing a project that uses dev dependencies. My particular case is usually for a project that includes tests and requires react-test-renderer as a devDependency. When imported the project complains that this dependency is missing. I don’t want this to be installed as a regular dependency.

Importing nested files causes dependency error

When importing from somewhere other than the root of a package, snack complains that the dependency is missing and prompts to install a dependency that includes the nested folder structure. If you do this, snack works, but the project fails locally because that package does not exist in npm (405 error).

For example: Add react-native-vector-icons/MaterialIcons to package.json? Add @react-native-community/async-storage/jest/async-storage-mock to package.json?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IjzerenHeincommented, Feb 12, 2021

@goatandsheep Supporting these kinds of situations where a working node-environment is needed goes beyond what Snack can offer. It’s good to know that there is a need for this though, but this will likely not be worked on in the foreseeable future.

0reactions
goatandsheepcommented, Feb 11, 2021

@IjzerenHein I’m also having an issue with devDependencies in my snack. I’m just trying to create a demo app for a babel plugin I maintain, but it’s not working because the devDependencies aren’t loading properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Module not found while importing nested module
If package2 tries to import package1 module we get an error that says module not found . Import looks like import { ......
Read more >
Nested Dependencies in Frontend - DEV Community ‍ ‍
Basically, node looks into every node_modules folder, starting in the module's parent directory and moving up the file tree, until it finds a ......
Read more >
How to fix nasty circular dependency issues once and for all in ...
So, it turns out that our circular dependency causes a nasty problem. However, if we look closely it is pretty easy to determine...
Read more >
Modules and Packages | First Steps - Cuetorials
Cue dependencies are located in the cue.mod/pkg/... directory. From here, dependent modules are nested under directories mirroring their import ...
Read more >
Imports - Terragrunt - Gruntwork
Hierarchical variables included across multiple terragrunt.hcl files; Reusing common variables; Reusing dependencies; Keeping remote state configuration DRY ...
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