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

getDefaultOpts is not defined #591

Closed
bkuhl opened this Issue Oct 2, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@bkuhl

bkuhl commented Oct 2, 2018

I'm attempting to import this library into a VueJS component and running into an unexpected error. Perhaps I'm doing this wrong?

My VueJS component contains import showdown from 'showdown/src/showdown alongside other imports that are loaded correctly. When I run my component I get the error:

showdown.js?25ac:9 Uncaught ReferenceError: getDefaultOpts is not defined
    at eval (showdown.js?25ac:9)
    at Object../node_modules/showdown/src/showdown.js (app.js?id=3655585264ebf1a5f704:1956)
    at __webpack_require__ (app.js?id=3655585264ebf1a5f704:20)

I'm attempting to use showdown like:

                converter: (function () {
                    return new showdown.Converter({
                        openLinksInNewWindow: true,
                    });
                })()

Then to use that dependency...

console.log(this.converter.makeHtml(this.body), this.body); // throws the error

I'm no expert in modern JS practices. What am I doing wrong when using this library to trigger this error?

@tivie tivie self-assigned this Oct 2, 2018

@tivie tivie added the help wanted label Oct 2, 2018

@tivie

This comment has been minimized.

Show comment
Hide comment
@tivie

tivie Oct 2, 2018

Member

The error is here:

at Object../node_modules/showdown/src/showdown.js

You cannot import directly from the src directory. You need to import from the dist directory, where all library files are concatenated.

Member

tivie commented Oct 2, 2018

The error is here:

at Object../node_modules/showdown/src/showdown.js

You cannot import directly from the src directory. You need to import from the dist directory, where all library files are concatenated.

@bkuhl

This comment has been minimized.

Show comment
Hide comment
@bkuhl

bkuhl Oct 2, 2018

Yep, thanks!

bkuhl commented Oct 2, 2018

Yep, thanks!

@bkuhl bkuhl closed this Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment