Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it did not contain a package, nor an index file #15030

Closed
chenghaohao opened this issue Jul 15, 2017 · 14 comments
Closed

it did not contain a package, nor an index file #15030

chenghaohao opened this issue Jul 15, 2017 · 14 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@chenghaohao
Copy link

Is this a bug report?

(write your answer here)

Have you read the Bugs section of the Contributing to React Native Guide?

(Write your answer here.)

Environment

  1. react-native -v: 0.46.1
  2. node -v:v6.10.3
  3. npm -v:3.10.10
  4. yarn --version (if you use Yarn):v0.24.5

Then, specify:

  • Target Platform: Android
  • Development Operating System: Windows10
  • Build tools:

Steps to Reproduce

(Write your steps here:)

1.react-native start
2.err shows up: bundling failed: "Unable to resolve module ./img/tabbar/[email protected] from F:\\code\\react-native\\meituanCopy\\src\\RootScene.js: could not resolve `F:\code\react-native\meituanCopy\src\img\tabbar\[email protected]' as a folder: it did not contain a package, nor an index file"
3.just using <Image
source={require('../img/tabbar/[email protected]')} /> and the png is existed

Expected Behavior

Actual Behavior

in v0.44.0 react-native , the code runs well..but when i copy the code to a new demo. the err shows...

Reproducible Demo

@Nomaq
Copy link

Nomaq commented Jul 16, 2017

I have the same problem the code was working correctly in 0.45.1 now i updated version and the images cannot load [email protected]' as a folder: it did not contain a package, nor an index file

@hramos hramos closed this as completed Jul 17, 2017
@nemophrost
Copy link

@hramos any resolution for this, or another issue that addresses it? Thanks!

@nemophrost
Copy link

I was able to fix this by changing my file names to ones without any @

@hramos
Copy link
Contributor

hramos commented Jul 19, 2017

Hey, thanks for reporting this issue!

It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

@henrypip
Copy link

@nemophrost I think this fixes it for me too but then it would break React Native's static image functionality? https://facebook.github.io/react-native/docs/images.html#static-image-resources

@henrypip
Copy link

henrypip commented Jul 23, 2017

Is this a bug report?

Yes

Have you read the Bugs section of the How to Contribute guide?

Yes

Environment

react-native -v: 0.46.1
node -v: v7.7.2
npm -v: 4.1.2
yarn --version: 0.24.6
expo: v19.0.0

Then, specify:

Target Platform: iOS
Development Operating System: MacOS 10.12.5
Build tools: Expo
Steps to Reproduce

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": ["transform-react-jsx-source"]
    }
  },
  "sourceMaps": true // https://marketplace.visualstudio.com/items?itemName=vsmobile.vscode-react-native
}

Errors on @2x and @3x, but when I take out the @ it works fine

require("./assets/images/placeholders/icon-image.png"),
      require('./assets/images/placeholders/[email protected]'),
      require("./assets/images/placeholders/[email protected]"),
require("./assets/images/placeholders/icon-image.png"),
      require('./assets/images/placeholders/icon-image2x.png'),
      require("./assets/images/placeholders/icon-image3x.png"),

Expected Behavior

Runs fine on Expo v18 (rn v0.45.1)

Actual Behavior

simulator screen shot 23 jul 2017 19 48 11

@nemophrost
Copy link

nemophrost commented Jul 25, 2017

@henrypip Yeah it could break static image stuff. In my case I was only using @2x without the others and using its path explicitly. Perhaps the bug would also be fixed if I wasn't explicitly referring to @2x and referred to a file without the density suffix, but I haven't tried it.

@craftdong
Copy link

any facebook offical solution for this issue? @hramos

@hramos
Copy link
Contributor

hramos commented Aug 3, 2017

I have not looked into this since the issue was closed. I recommend opening a new issue (and following the template).

@sytolk
Copy link

sytolk commented Aug 19, 2017

@hramos have you see this? #15030 (comment) (I think that the template is following)
Why not simple reopen this issue instead of opening new one ??

@mo-solnet
Copy link

I've created a ticket for this issue against the metro-bundler project 👉 facebook/metro#43

@milon87
Copy link

milon87 commented Sep 15, 2017

I have got the same error.
The solution in my case:
import path was wrong, after fixing import from exact path problem resolved.

@alihaydarkoc
Copy link

dont support png u should transform jpg

@hramos
Copy link
Contributor

hramos commented Oct 27, 2017

@sytolk there's hundreds of comments across issues and PRs on this repo every day, it's easy for things to slip by. Still, I highly recommend opening a new issue that meets the guidelines - the author still hasn't updated their original post, and the comment with the additional details was not from the OP. A new issue would make things easier for everyone.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 17, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests