I am having trouble deploying an upgradeable contract. The contract deploys just fine if I deploy regularly, but having trouble reading some artifact when doing deployProxy. Any ideas?
Environment
Truffle v5.3.4 (core: 5.3.4)
Solidity - 0.6 (solc-js)
Node v12.18.3
Web3.js v1.3.5
Details
SyntaxError: Unexpected token . in JSON at position 1
at JSON.parse (<anonymous>)
at C:\...\npm\node_modules\@openzeppelin\truffle-upgrades\src\utils\validations.ts:25:41
at Array.map (<anonymous>)
at readArtifacts (C:\...\npm\node_modules\@openzeppelin\truffle-upgrades\src\utils\validations.ts:25:27)
at Object.validateArtifacts (C:\...\npm\node_modules\@openzeppelin\truffle-upgrades\src\utils\validations.ts:16:21)
at Object.deployImpl (C:\...\npm\node_modules\@openzeppelin\truffle-upgrades\src\utils\deploy-impl.ts:29:23)
at deployProxy (C:\...\npm\node_modules\@openzeppelin\truffle-upgrades\src\deploy-proxy.ts:46:16)
at module.exports (C:\...\2_deploy_contracts.js:5:3)
at Migration._deploy (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:79:1)
at Migration._load (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:61:1)
at Migration.run (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:212:1)
at Object.runMigrations (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.runAll (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:114:1)
at Object.run (C:\...\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:79:1)
at runMigrations (C:\...\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:263:1)
at Object.run (C:\...\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:228:1)
at Command.run (C:\...\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:140:1)
Truffle v5.3.4 (core: 5.3.4)
Node v12.18.3
Code to reproduce
deploy contract:
const { deployProxy } = require('@openzeppelin/truffle-upgrades');
var token = artifacts.require("Token");
module.exports = async function(deployer) {
await deployProxy(token , [], { deployer, initializer: 'init' });
};