Prefetch no longer available in @edgio/react

Hi, it seems since version 7.x.x Prefetch is no longer available in @edgio/react.
In the node_modules folder I can see the Prefect.js file is there, however Prefetch.d.ts is missing and in index.d.ts there’s no reference to it neither.

Downfrading to version 6 fixes the problem, however I miss useServiceWorker.

It checked the source and it looks like in version 7, the Prefetch module was changed from .ts to .js. I am not sure why this change occurred, but I do see that index.js is exporting the 3 modules:

export { default as Prefetch } from './Prefetch'
export { default as useServiceWorker } from './useServiceWorker'
export { default as useDevtools } from './useDevtools'

You will likely need to ignore any error about the Prefetch type declaration missing.

Hi Tristan,
unfortunately I dont see that. What I see is

export { default as useServiceWorker } from './useServiceWorker'
export { default as useDevtools } from './useDevtools'

I’m on NodeJs v16.20.2
and npm 8.19.4

not sure the issue may be that.

I’ve solved it this way

const Prefetch = require('@edgio/react/Prefetch.js').default;

not really ideal, but seems to do the job :slight_smile:

Hello @efortunati,
this issue with missing types for @edgio/react/Prefetch component should now be fixed in the latest version 7.7.2.

Thank you for reporting it.