Warning: The "to" argument must be of type string.
See original GitHub issueSetup:
- Windows 10
- Node v10.15.3
- npm 6.4.1
- yarn 1.16.0
- grunt 1.0.4
Gruntfile.js
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
babel: {
dist: {
files: {
'js/app.js': 'js/app-compiled.js'
}
}
},
});
grunt.registerTask("build", ["babel",]);
}
When i enter “grunt build” i receive respond:
Warning: The "to" argument must be of type string. Received type undefined Use --force to continue.
and only this. What is a “to” argument and why it isn’t be of type string? After all this is taken from the example and does not work.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Gruntfile.js Warning: The "path" argument must be of type ...
Warning : The "path" argument must be of type string. Received type object Use --force to continue. Aborted due to warnings. Process terminated ......
Read more >[err_invalid_arg_type]: the "path" argument must be of type ...
In Node 15 brfs throw error The "path" argument must be of type string or an instance of Buffer or URL. Received undefined...
Read more >[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path ...
Have you run into the error “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined”? In this story I'll go...
Read more >Pipelines fail randomly with ##[error]TypeError ...
Pipelines fail randomly with ##[error]TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined.
Read more >The "path" argument must be of type string - SAP Community
I have found such warning when Workspace is created: Problems loading reference 'vscode://schemas/workspaceConfig': Unable to load schema from ' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe the error you’re getting is that Babel cannot compile
fileA.js
intofileB.js
becausefileA.js
doesn’t exist.In the
files
object of the config, the key should be the output file name and the value should be the name of the file you want converted (seems backwards, but it makes sense if you look at it this way).So in your example:
You’re trying to convert a file called
js/app-compiled.js
intojs/app.js
. I believe you have these backwards, you should have a file calledjs/app.js
and you want grunt / babel to compile that into a new file calledjs/app-compiled.js
. Update your config to look like this and make sure you have a file called app.js in the correct location:@RiddickAbaddon I’m not sure if you realized it already, but i realized it shortly after i posted here. The source file was not created. In my case, I was using concat first and the output from concat didnt create a file. therefore, babel didn’t find any file to work with. not sure if this is the same issue you have, but once i had the file in place, everything went fine.