Magento 2 require is not defined

Andrii picture Andrii · Nov 27, 2015 · Viewed 7.1k times · Source

After installing magento 2 CE, I had

ReferenceError: require is not defined in console. I found this solution

c:\xampp\php\php.exe -f d:\projects\localsites\magento2.local\magento\bin\magento -- setup:static-content:deploy And that helps me, but every time when I flush my static cache, this problem happens again. How I can solve this problem "forever".

Answer

Mage2.PRO picture Mage2.PRO · Nov 27, 2015

Switch to the developer mode, and the static content will be deployed automatically (no need for setup:static-content:deploy).