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.

Compilation crash: `Error: Content and Map of this Source is not available (only size() is supported)`

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • build
  • serve

Is this a regression?

Yes, didn’t see this with Angular 12.

Description

I’m running into Error: Content and Map of this Source is not available (only size() is supported) with Angular.

This seems to have been reported in various other places recently: stackoverflow.com/questions/70066980/angular-12-content-and-map-of-this-source-is-not-available-only-size-is-suppo

I’m not sure if this is an Angular or Webpack issue, I also crossposted this to webpack: https://github.com/webpack/webpack/issues/14840

🔬 Minimal Reproduction

I don’t have a clear reproduction, however I was able to add some logs in emitAsset here, which is part of the stack trace: https://github.com/webpack/webpack/blob/14582fc41504595b04f01561ea19d27391d6b9ac/lib/Compilation.js#L4171-L4176

I added:

	emitAsset(file, source, assetInfo = {}) {
		if (this.assets[file]) {
			try {
				!isSourceEqual(this.assets[file], source);
			} catch (err) {
				console.error(file, this.assets[file], source);
				throw err;
			}

The output before the crash is:

fontawesome-webfont.eot SizeOnlySource { _size: 165742 } RawSource {
  _valueIsBuffer: true,
  _value: <Buffer 6e 87 02 00 ac 86 02 00 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 90 01 00 00 00 00 4c 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 165692 more bytes>,
  _valueAsBuffer: <Buffer 6e 87 02 00 ac 86 02 00 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 90 01 00 00 00 00 4c 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 165692 more bytes>,
  _valueAsString: undefined
}

It always seems to crash on the same eot file. Notice that this.assets[file] for this file is a SizeOnlySource.

🔥 Exception or Error

.../node_modules/webpack-sources/lib/SizeOnlySource.js:16
                return new Error(
                       ^

Error: Content and Map of this Source is not available (only size() is supported)
    at SizeOnlySource._error (.../node_modules/webpack-sources/lib/SizeOnlySource.js:16:10)
    at SizeOnlySource.buffer (.../node_modules/webpack-sources/lib/SizeOnlySource.js:30:14)
    at _isSourceEqual (.../node_modules/webpack/lib/util/source.js:21:51)
    at isSourceEqual (.../node_modules/webpack/lib/util/source.js:43:17)
    at Compilation.emitAsset (.../node_modules/webpack/lib/Compilation.js:4155:9)
    at .../node_modules/webpack/lib/Compiler.js:546:28
    at .../node_modules/webpack/lib/Compiler.js:1127:17
    at eval (eval at create (.../node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
The terminal process "zsh '-c', 'yarn run start'" terminated with exit code: 1.

🌍 Your Environment

Angular CLI: 13.0.2
Node: 16.13.0
Package Manager: yarn 3.1.0
OS: darwin arm64

Angular: 13.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.2
@angular-devkit/build-angular   13.0.2
@angular-devkit/core            13.0.2
@angular-devkit/schematics      13.0.2
@angular/cli                    13.0.2
@angular/flex-layout            12.0.0-beta.35
@schematics/angular             13.0.2
rxjs                            7.4.0
typescript                      4.4.4```

**Anything else relevant?**

<!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->

<!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:33 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
lalo-mxcommented, Jan 14, 2022

@alan-agius4 The issue is not reproducible for us anymore. It has has been stable for more than a month now.

1reaction
alan-agius4commented, Dec 10, 2021

@alan-agius4 Not 100% sure if is the same error but it crashes similarly sample-angular-13.zip

Updating to latest @angular/cli and @angular/core to 13.1.0 version appears to fix it, i will run more tests.

npm run start-fast

@lalo-mx, I downloaded the project, but I wasn’t able to reproduce the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash with `Error: Content and Map of this Source is not ...
Bug report I'm running into Error: Content and Map of this Source is not available (only size() is supported) with Angular.
Read more >
"Content and Map of this Source is not available" error after ...
I have encountered the same issue today and I was able to solve the problem by installing the 'source-map-support' npm package:
Read more >
Troubleshooting common SPMT issues and errors
In this article, you'll learn how to troubleshoot common errors in the SharePoint Migration Tool (SPMT).
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
We're going to presume that you've already produced a source map using a tool like UglifyJS or Webpack. But generating a source map...
Read more >
Troubleshoot—ArcGIS Maps for Adobe Creative Cloud
Listed below are error messages you may encounter when working with the ArcGIS Maps for Adobe Creative Cloud extension and some recommended solutions....
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