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.

I’m submitting a …

[x] bug report => check the README and search github for a similar issue or PR before submitting
[x] support request => check the README and search github for a similar issue or PR before submitting
[ ] feature request

Current behavior adding <img src="assets/pic.jpg" /> to app.component.html (and a pic.jpg in the assets folder) gives the error: Can't resolve './assets/pic.jpg'

changing the path of the asset to relative, i.e making it <img src="../assets/pic.jpg" /> gives the error: Error: Path variable [chunkhash] not implemented in this context: assets/pic.[chunkhash].jpg. Assets should not be relative so adding the ../ shouldn’t work in any case.

I run using: npm run build:universal-prod; npm run serve; Expected/desired behavior

It should work. Or perhaps this is configured to work with different sort of paths? If so, please advice.

Please tell us about your environment: Windows 10

  • Browser: all

  • **Quick Solution: ** changing chunkhash to hash in the webpack.common.js file seems to fix this error though I’m not sure what complications that might have. Although the path would need to be relative to the current location, and ideally we should just be able to do assets/pic.jpg or something of the sort.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
artemSoliarcommented, Jul 19, 2017

in webpack.config.js file add like this

 new copyWebpackPlugin([
     {
          from: `${root(settings.paths.src.client.assets.root)}/pic.jpg`,
          to: './pic.jpg'
        },]

more https://github.com/kevlened/copy-webpack-plugin

0reactions
fulls1z3commented, Aug 2, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

2 Easy Steps to Fix Unable to Load Asset in Flutter (2022)
Let's quickly see 2 EASY ways to fix the unable to load asset in Flutter in 2 easy steps with practical examples.
Read more >
I can't add the image from assets file in Flutter - Stack Overflow
I'm new at flutter and I want to add a picture to my app. I coded something like this ...
Read more >
can't add images as assets in Asset Browser
You'll need to download 3.1 Beta and enable "Extended Asset Browser" in the experimental panel of the preferences for now.
Read more >
Cant add asset to export assets panel
Hi , like the title reads im not able to add an asset i need to export, into the assets panel. it's just...
Read more >
Why can't I download an Asset? - Unity Support
Why can't I download an Asset? · You have a firewall or proxy in place, which is blocking the connection to the server....
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