Skip to content

Build script fails on Windows #52

Closed
@gratrockstar

Description

The npm run build and npm run start commands fail on Windows, producing tons of errors. Here's an example, this error seems to be repeated for every scss file (here, ... is the path to the WP install):

ERROR in css/style
Module not found: Error: Can't resolve '.\assets\scss\_index.scss' in 'C:\...\wp-content\themes\wds-bt'
Did you mean './.\assets\scss\_index.scss'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
resolve '.\assets\scss\_index.scss' in 'C:\...\wp-content\themes\wds-bt'
  Parsed request is a module
  using description file: C:\...\wp-content\themes\wds-bt\package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in C:\...\wp-content\themes\wds-bt\node_modules
        single file module
          using description file: C:\...\wp-content\themes\wds-bt\package.json (relative path: ./node_modules/assets/scss/_index.scss)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss.jsx doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss.ts doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss.tsx doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss.json doesn't exist
            .wasm
              Field 'browser' doesn't contain a valid alias configuration
              C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss.wasm doesn't exist
        C:\...\wp-content\themes\wds-bt\node_modules\assets\scss\_index.scss doesn't exist
      C:\...\wp-content\themes\node_modules doesn't exist or is not a directory
      C:\...\wp-content\node_modules doesn't exist or is not a directory
      C:\...\node_modules doesn't exist or is not a directory
      ...
      C:\node_modules doesn't exist or is not a directory

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions