Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

extract-loader causing build to fail with .scss file #783

Closed
mattclough1 opened this issue Sep 27, 2018 · 2 comments
Closed

extract-loader causing build to fail with .scss file #783

mattclough1 opened this issue Sep 27, 2018 · 2 comments

Comments

@mattclough1
Copy link

mattclough1 commented Sep 27, 2018

Problem

extract-loader causing build to fail when attempting to include an asset url to a .scss file

Example output:

./layout/checkout.liquid
Module build failed (from ../node_modules/@shopify/slate-tools/node_modules/extract-loader/lib/extractLoader.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) ReferenceError: require is not defined
    at runLoaders (/Users/mattclough/Repos/ng-theme/node_modules/@shopify/slate-tools/node_modules/webpack/lib/NormalModule.js:283:13)
    at /Users/mattclough/Repos/ng-theme/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /Users/mattclough/Repos/ng-theme/node_modules/loader-runner/lib/LoaderRunner.js:230:18
    at context.callback (/Users/mattclough/Repos/ng-theme/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
 @ . sync ^\.\/layout.*\.liquid$ ./layout/checkout.liquid
 @ ../node_modules/@shopify/slate-tools/tools/webpack/static-files-glob.js
 @ multi ../node_modules/@shopify/slate-tools/tools/webpack/hot-client.js ../node_modules/@shopify/slate-tools/tools/webpack/static-files-glob.js

Replication steps

  1. Run yarn start to start compilation of theme
  2. Create a .scss file
  3. In a liquid template, try including the stylesheet using its relative path, e.g.: {{ '../assets/styles/new-style.scss' | asset_url | stylesheet_tag }}

More Information

This may be fixed by upgrading extract-loader as noted here:
peerigon/extract-loader#2

UPDATE
Forked and upgraded extract-loader. The above error is replaced by a similar error require(...) is not a function

@t-kelly
Copy link
Contributor

t-kelly commented Oct 25, 2018

@t-kelly t-kelly closed this as completed Oct 25, 2018
@lock
Copy link

lock bot commented Nov 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants