If I try to include a PS module in JS code with either of these techniques:
var Tps = require('Test.Foo')
// or
var Tps = require('./output/Test.Foo')
I encounter a cannot fine module 'Test.Foo'
error when running spago test
.
Here’s a minimal repo configured to reproduce this issue:
git clone https://github.com/milesfrain/spago_require
cd spago_require
spago test
[info] Build succeeded.
internal/modules/cjs/loader.js:615
throw err;
^
Error: Cannot find module ‘./output/Test.Foo’
Once I get this working, I’ll update chapter 10 to include better instructions. I’m also planning to add the fix described in this related thread.
There’s a similar spago github issue, but that’s resolved. Not sure if I’m encountering a regression.