Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hope-ui does not work in Vitest #207

Open
misogihagi opened this issue Sep 2, 2022 · 2 comments
Open

hope-ui does not work in Vitest #207

misogihagi opened this issue Sep 2, 2022 · 2 comments

Comments

@misogihagi
Copy link

Describe the bug

When I ran simple vitest with Hope UI, I got the following error message.

SyntaxError: Named export 'addScrollableSelector' not found. The requested module 'scroll-lock' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'scroll-lock';
const { addScrollableSelector, disablePageScroll, removeScrollableSelector, clearQueueScrollLocks, enablePageScroll } = pkg;

To Reproduce

here is my component

import type { Component } from 'solid-js';

import {
    HopeProvider,Box
  } from "@hope-ui/solid";
  
export default function (Tes: Component ) {
    return (<HopeProvider><Box>test</Box></HopeProvider>)
}

and test code

import {describe, it, expect} from 'vitest';
import {render} from 'solid-testing-library';
import Tes from './Tes';

it('render test', () => {
    render(()=><Tes></Tes>);
});
  • OS: Linux
  • Version 0.6.7
@hhhxxjj
Copy link

hhhxxjj commented Sep 3, 2022

I got the same error message. Now I use uvu instead of vitest.

@fabien-ml
Copy link
Collaborator

Hi, Not sure I can help since i've never used Vitest.

scroll-lock is an internal dependency which will be removed in 1.0, but I don't know if others internal dependencies will cause the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants