Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix files that get published to npm, fix custom element constructor a…
…nd fix some missing server safe globals (#38) * fix places where unsafe document global was being used * move this._updateRange() to connectedCallback According to the spec: https://html.spec.whatwg.org/multipage/scripting.html#custom-element-conformance > In general, work should be deferred to connectedCallback as much as possible—especially work involving fetching resources or rendering. However, note that connectedCallback can be called more than once, so any initialization work that is truly one-time will need a guard to prevent it from running twice. In a react application, I was seeing this error: react-dom.development.js?61bb:5895 Uncaught DOMException: Failed to construct 'CustomElement': The result must not have attributes at createElement (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:5895:34) at createInstance (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:7490:20) at completeWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18970:28) at completeUnitOfWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22192:16) at performUnitOfWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22165:12) at workLoopSync (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22130:22) at performSyncWorkOnRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21756:9) at eval (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11089:24) at unstable_runWithPriority (webpack-internal:///./node_modules/scheduler/cjs/scheduler.development.js:653:12) at runWithPriority$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11039:10) at flushSyncCallbackQueueImpl (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11084:7) at flushSyncCallbackQueue (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11072:3) at scheduleUpdateOnFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21199:9) at updateContainer (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24373:3) at legacyRenderSubtreeIntoContainer (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24774:5) at Object.render (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24840:10) at renderReactElement (webpack-internal:///./node_modules/next/dist/client/index.js:590:28) * fix files: [] array to include everything in dist/ (dont need examples/) * add examples/ back in to files: [] array * move comment back to constructor
- Loading branch information
6707e0f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: