title: Svelte (rollup) - Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
body: <p>I am doing <strong>nothing</strong> to trigger this error. The app works fine one second, and doesn't the next.</p>
  <p>Why is this happening? It is not due to the missing <code>@rollup/plugin-json</code> plugin because it worked previously without it.</p>
  <h1>Error</h1>
  <pre><code>https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
  path (imported by  path?commonjs-external)
  http (imported by  http?commonjs-external)
  net (imported by  net?commonjs-external)
  url (imported by  url?commonjs-external)
  [!] Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
  node_modules/mime-db/db.json (2:40)
  1: {
  2:   &quot;application/1d-interleaved-parityfec&quot;: {
                                             ^
  3:     &quot;source&quot;: &quot;iana&quot;
  4:   },
  Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
      at error (/mnt/c/ivan/dev/lab/atlas-biotek/node_modules/rollup/dist/shared/rollup.js:5265:30)
      at Module.error (/mnt/c/ivan/dev/lab/atlas-biotek/node_modules/rollup/dist/shared/rollup.js:9835:16)
      at tryParse (/mnt/c/ivan/dev/lab/atlas-biotek/node_modules/rollup/dist/shared/rollup.js:9716:23)
      at Module.setSource (/mnt/c/ivan/dev/lab/atlas-biotek/node_modules/rollup/dist/shared/rollup.js:10142:19)
      at ModuleLoader.addModuleSource (/mnt/c/ivan/dev/lab/atlas-biotek/node_modules/rollup/dist/shared/rollup.js:18312:20)
  </code></pre>
  <h1>Adding the plugin</h1>
  <pre><code>npm i @rollup/plugin-json --save-dev
  </code></pre>
  <p><strong>rollup.js.config</strong></p>
  <pre class="lang-js prettyprint-override"><code>import json from &quot;@rollup/plugin-json&quot;;
  
  export default {
      plugins: [
          commonjs(),
          json(),      // &lt;---- put after commonjs
      ]
  }
  </code></pre>
  <h1>Client error</h1>
  <pre><code>Uncaught ReferenceError: require$$0$1 is not defined
      at main.js:5
  (anonymous) @ main.js:5
  </code></pre>
  <p><img src="https://user-images.githubusercontent.com/16456606/100885436-eeca7200-34b2-11eb-9dd4-8b4686d81e15.jpg" alt="UNCAUGHT" /></p>