Closed Gekctek closed 1 year ago
We are currently investigating this bug in moc.js
(which powers both the VS Code extension and Motoko Playground).
As a temporary solution, you could try something like the following:
import Text "mo:base/Text";
let xml = Text.decodeUtf8("<?xml version=\"1.0\" encoding=\"UTF-8\"?><feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en\"><title>The Verge - All Posts</title><icon>https://cdn.vox-cdn.com/community_logos/52801/VER_Logomark_32x32..png</icon><updated>2022-11-21T21:30:42-05:00</updated>...</feed>");
This works by defining a Blob
literal and converting to a Text
value to get around this bug with the type checker.
I'll keep you posted and will update the VS Code extension as soon as this is fixed.
This will be fixed in version 0.10.1 of the VS Code extension. Cheers!
I have some test data that I want to use, but when putting a string of a very long length into the code, the whole file fails to compile in VSCode but with the command line. I have tested and just removing a chunk of it does fix the issue.
This is just an annoyance because I cant see errors in VSCode but I can still run the tests.
Are there good practices for having large files/values attached to motoko code?
string value using: