gavinmcfarland / stancy

A simple API for delivering content from static files and folders.
https://stancy.vercel.app/
Creative Commons Zero v1.0 Universal
8 stars 2 forks source link

Importing Stancy into Sapper causes error #1

Closed gavinmcfarland closed 4 years ago

gavinmcfarland commented 4 years ago

When the module is imported by a file consumed by Sapper the following error is returned:

✗ client
Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
1: ����(__TEXT@@__text__TEXT>
   ^
2: 
3: >

Having difficulty figuring out what's causing this because the module only uses fs to read json, markdown, text and yaml files and these occur on the host (Sapper project).

gavinmcfarland commented 4 years ago

Solved this by creating a separate bundle for the client which did not include imports to built-in modules.