'Magento 2 require is not defined

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".



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Brad Larson