ERROR Cannot read property 'targetDirectory' of undefined
lohnsonok opened this issue · 3 comments
yarn run v1.22.5
$ peeky open
ERROR esbuild error with options used: { 21:59:31
loader: '',
sourcemap: true,
sourcefile: '.eslintignore',
target: [
'node14.17.5'
],
format: 'cjs'
}
ERROR Transform failed with 1 error: 21:59:31
.eslintignore:1:1: error: Syntax error " "
.eslintignore:1:1: error: Syntax error " "
at failureErrorWithLog (node_modules/esbuild/lib/main.js:1160:15)
at node_modules/esbuild/lib/main.js:1026:33
at node_modules/esbuild/lib/main.js:542:9
at handleIncomingPacket (node_modules/esbuild/lib/main.js:631:9)
at Socket.readFromStdout (node_modules/esbuild/lib/main.js:509:7)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at Socket.Readable.push (internal/streams/readable.js:204:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
ERROR Cannot read property 'targetDirectory' of undefined 21:59:31
at createServer (node_modules/@peeky/server/dist/index.js:96920:21)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Command2. (node_modules/@peeky/cli/dist/index.js:10861:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
my peeky.config.js
`import path from 'path'
export default defineConfig({
targetDirectory: path.join(__dirname, './src/tests'),
})`
Could you share a runnable reproduction? Thanks!
Ran into this issue as well. Fairly certain it has to do with using ES6 importing syntax on a regular *.js file. If you rename it to peeky.config.mjs
(note the extension *.mjs). That should fix it. Or if you don't want to change the extension, use common JS syntax. const path = require('path')
.
I should probably make this clearer in the docs.