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

can't display code while create project with npx create-code-surfer-deck #66

Closed
aisy opened this issue Aug 15, 2019 · 6 comments
Closed

Comments

@aisy
Copy link

aisy commented Aug 15, 2019

When I create a project using the npx create-code-surfer-deck command and there is an error like this when I use code like this:

<Code    code = {require ("!! file-loader! ./ codes / fetchIntro / callFetch"). default} />

and error is :
TypeError: Cannot read property 'dimensions' of undefined

fyi:
Previously I made a project using the npx create-code-surfer-deck command and it worked fine

@pomber
Copy link
Owner

pomber commented Aug 15, 2019

Have you tried using raw-loader instead of file-loader?

@aisy
Copy link
Author

aisy commented Aug 16, 2019

Yes..
but same result,
i'm using same code with previous project like this :

<CodeSurferLayout>
   <Code
     code={"!!raw-loader!./src/codes/App.js"}
   />
</CodeSurferLayout>

@pomber
Copy link
Owner

pomber commented Aug 17, 2019

Does it also happen when you use the Code component without importing code from another file? Maybe it's the Code component that is broken.

@melcor76
Copy link

melcor76 commented Aug 17, 2019

This is happening to me as well when I import from files. But it worked before.
I'm thinking some mdx (or other) dependencies changed when I started a new project.

@pomber
Copy link
Owner

pomber commented Aug 17, 2019

I'm thinking some mdx (or other) dependencies changed when I started a new project.

I haven't tried it yet, but that could be the reason. The last version of mdx is probably wrapping the Code element making code surfer fail.

I thought I pinned the versions to avoid this kind of problems, but I'm bad with dependencies.

If anyone wants to send a PR to fix it in create-code-surfer-deck I'll merge it, if not I'm updating it to v3 soon.

@pomber
Copy link
Owner

pomber commented Dec 10, 2019

Should be fixed in v3 (see https://codesurfer.pomb.us/#import-code)

@pomber pomber closed this as completed Dec 10, 2019
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