Skip to content

[Bug]: sourceMaps not being generated. #14943

@trusktr

Description

@trusktr

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/cli

Input code

// ...any code here...

Configuration file name

babel.config.js

Configuration

Any one of these:

module.exports = {
	sourceMaps: true, // <---------------------------------------- nothing happens
	plugins: [
		['@babel/plugin-proposal-optional-chaining', {}],
		['@babel/plugin-proposal-nullish-coalescing-operator', {}],
		['@babel/plugin-transform-typescript', {allowDeclareFields: true}],
		['@babel/plugin-proposal-decorators', {version: '2022-03'}],
		['@babel/plugin-proposal-class-static-block'],
	],
	presets: [
		['@babel/preset-typescript', {isTSX: true, allExtensions: true, onlyRemoveTypeImports: true}],
		['babel-preset-solid', {moduleName: '@lume/element'}],
	],
}
module.exports = {
	sourceMaps: 'inline', // <---------------------------------------- nothing happens
	plugins: [
		['@babel/plugin-proposal-optional-chaining', {}],
		['@babel/plugin-proposal-nullish-coalescing-operator', {}],
		['@babel/plugin-transform-typescript', {allowDeclareFields: true}],
		['@babel/plugin-proposal-decorators', {version: '2022-03'}],
		['@babel/plugin-proposal-class-static-block'],
	],
	presets: [
		['@babel/preset-typescript', {isTSX: true, allExtensions: true, onlyRemoveTypeImports: true}],
		['babel-preset-solid', {moduleName: '@lume/element'}],
	],
}

Current and expected behavior

Expected: Source maps are outputted.

Actual: Nothing happens.

The 'both' option does output source maps, but only inline (?), and there is apparently no way to make it output separate files.

Environment

  System:
    OS: macOS 12.5
  Binaries:
    Node: 18.8.0 - ~/.n-node-versions/bin/node
    npm: 8.19.1 - ~/.npm-packages/bin/npm
  npmPackages:
    @babel/cli: ^7.11.6 => 7.18.10 
    @babel/core: ^7.11.6 => 7.19.1 
    @babel/plugin-proposal-class-properties: ^7.10.4 => 7.18.6 
    @babel/plugin-proposal-class-static-block: ^7.18.6 => 7.18.6 
    @babel/plugin-proposal-decorators: ^7.10.5 => 7.19.1 
    @babel/plugin-proposal-nullish-coalescing-operator: ^7.10.4 => 7.18.6 
    @babel/plugin-proposal-optional-chaining: ^7.11.0 => 7.18.9 
    @babel/preset-typescript: ^7.12.7 => 7.18.6 
    @babel/runtime: ^7.11.2 => 7.19.0 
    babel-loader: ^8.2.2 => 8.2.5 
    babel-preset-solid: ^1.0.0 => 1.5.4 
    webpack: ^5.72.0 => 5.74.0 

Possible solution

Make sourceMaps: true do something rather than being a useless option that leads people to false expectations, or remove the option.

Also make it possible to output separate files.

Additional context

#2484

#5261

Metadata

Metadata

Assignees

Labels

i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions