Undefined index when using copy/copydirectory
See original GitHub issue- Laravel Mix Version: 1.4.5
- Node Version: v6.10.2
- NPM Version: 3.10.10
- OS: windows 10 xampp
Description:
Undefined index when using copy/copyDirectory and {{ mix() }}
Steps To Reproduce:
Create 2 folders in resources
/css/afolder/afile.css
/css/another/anotherfile.css
Copy the folders with the following:
mix.copy('resources/assets/css/', 'public/css', false);
or
mix.copyDirectory('resources/assets/css/', 'public/css');
The files are copied fine, but when using
{{ mix('css/afolder/afile.css') }}
or
{{ mix('css/anotherfolder/anotherfile.css') }}
It returns back
Undefined index: css/afolder/afile.css
Undefined index: css/anotherfolder/anotherfile.css
The folders exists:
public/css/afolder/afile.css
public/css/anotherfolder/anotherfile.css
Mix manifest just shows the following
{
"/js/app.js": "/js/app.js?id=0eaf1649511b8f1c3fd9",
"/css/app.css": "/css/app.css?id=a86d86d0b7edd1152cc6"
}
Full webpackmix file
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/assets/js/app.js', 'public/js');
mix.copy('resources/assets/js/', 'public/js', false);
mix.copy('resources/assets/css/', 'public/css', false);
mix.sass('resources/assets/sass/app.scss', 'public/css');
mix.version();
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
What is an Undefined Index PHP Error? How to Fix It?
Undefined Index is a notice in PHP, and it is a choice of the developer to either ignore it or fix it.
Read more >php - “Undefined index” when using $_GET - Stack Overflow
The error is because the $_GET['username'] var doesn't exist. You can execute var_dump($_GET) or print_r($_GET) to see all available values. You ...
Read more >Notice: Undefined Index error in PHP - STechies
This error means that within your code, there is a variable or constant that has no value assigned to it. But you may...
Read more >Notice: Undefined index - WordPress.org
Keep getting this error even I tried using Rookie theme. Please help. The page I need help with: [log in to see the...
Read more >PHP Notice Undefined Index | Syntax | Working and Examples
Guide to PHP Notice Undefined Index. Here we discuss the introduction, syntax, and working of notice undefined index in PHP with examples.
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 Free
Top 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
Reproduced.
According to the documentation, you have to specify these ‘extra’ files or folders you may want versioned.