Skip to content

TypeError: Filename must be a string #5

@AndrewRayCode

Description

@AndrewRayCode

I'm not sure what's causing this yet. I will close this bug if it turns out to be our fault. I included the babel rewire plugin in our webpack config:

babel-loader?plugins=rewire&optional=runtime

When I run webpack (building our test bundle), I get:

ERROR in vendors.js
Module build failed: TypeError: Filename must be a string

The content of vendors.js aren't anything exciting:

require('react');
require('lodash');
require('react-router');

The stack trace exits at

at Object.module.exports (/node_modules/babel-loader/index.js:43:24)

so I'm not sure what's originating the error. If I log inside that line to see what filename is it prints out a very large object that isn't immediately recognizable.

Does this plugin still work with regular require statements alongside es6 import statements? Actually, even if I make the contents of that file only import "react"; it gives me the same error...

Might be worth noting I'm using rewire-webpack, although this error still persists if I remove rewire-webpack it from my webpack plugins list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions