Get CloudKit.js working with Next.js? #13984
-
I downloaded https://cdn.apple-cloudkit.com/ck/2/cloudkit.js. I stuck it in /public/. I imported it by:
In
My next.config.js
However, compiling results in:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think you'll want to put that anywhere else except the Aside from that, you'll likely need to include the extension when importing it. so Alternatively it looks like Apple recommends just including it via their CDN in a |
Beta Was this translation helpful? Give feedback.
I think you'll want to put that anywhere else except the
public
folder. That folder is best used to serve other static assets.Aside from that, you'll likely need to include the extension when importing it. so
import CloudKit from '../scripts/cloudkit.js'
. Otherwise webpack won't know how to resolve it.Alternatively it looks like Apple recommends just including it via their CDN in a
script
tag, so that may be best.