superstruct icon indicating copy to clipboard operation
superstruct copied to clipboard

Uncaught TypeError: (0 , _superstruct.string) is not a function

Open arslion opened this issue 3 years ago • 1 comments

I try to execute this validate example: https://docs.superstructjs.org/guides/02-validating-data#primitive-values

import { string } from 'superstruct'

const Struct = string()

assert('a string', Struct) // passes
assert(42, Struct) // throws!

and got this error.

File.jsx:11 Uncaught TypeError: (0 , _superstruct.string) is not a function
    at Form (File.jsx:11)
    at renderWithHooks (react-dom.development.js:14803)
    at mountIndeterminateComponent (react-dom.development.js:17482)
    at beginWork (react-dom.development.js:18596)
    at HTMLUnknownElement.callCallback (react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
    at invokeGuardedCallback (react-dom.development.js:292)
    at beginWork$1 (react-dom.development.js:23203)
    at performUnitOfWork (react-dom.development.js:22154)
    at workLoopSync (react-dom.development.js:22130)

arslion avatar Apr 10 '21 14:04 arslion

Same issue.... the suggestion in #612 doesn't seem to work for me...

stonecrafter avatar Jan 05 '22 08:01 stonecrafter