#staticDirs

7 messages · Page 1 of 1 (latest)

opaque nimbus
#

I dont understand why sb cannot just work?! I had a hell of a time to get next/font loading my local fonts correctly! Now msw is failing to load!

This is the error:

TypeError: Failed to update a ServiceWorker for scope ('http://localhost:6006/') with script ('http://localhost:6006/mockServiceWorker.js'): A bad HTTP response code (404) was received when fetching the script.
```

In order to get fonts working I had to change staticDirs in main.ts

```ts
staticDirs: [
    {
      from: '../public',
      to: 'public',
    },
  ],
```

When I change this back to default
```ts
staticDirs: ['../public']
```
the serviceworker loads correctly but my fonts dont... 

Any ideas why?
glossy marten
#

try:

staticDirs:[
  '../public',
    {
      from: '../public',
      to: 'public'
    }
]
opaque nimbus
#

hmm ok that works...

#

now iam getting some warnings:

#

[MSW] Warning: captured a request without a matching request handler:

• GET /vendors-node_modules_babel_runtime_helpers_esm_extends_js-node_modules_floating-ui_react-dom_-c7aefd.iframe.bundle.js

If you still wish to intercept this unhandled request, please create a request handler for it.

#

I am a bit confused anyway, in my last project I used the mswDecorator and passed it into decorators in preview... now I am supposed to use mswLoader and pass it into loaders... is that correct?

#

ok I found the bypass setting